2015-01-15 1 views
2

저는 블루 핀 jquery 파일 uploade입니다. 나는 image_versions를 더 만들려고 노력했다. 첫 번째 및 마지막 image_version이 작동합니다. 내 경우에는 ''작은 '및'미리보기 이미지 '가 작동하고 다른 하나는 작동하지 않습니다. 다른 image_versions에서는 이미지가 업로드되지만 올바른 크기로 크기가 조정되지 않습니다.blueimp jquery 파일 업 로더 image_versions이 작동하지 않습니다.

'image_versions' => array(
      // The empty image version key defines options for the original image: 
      '' => array(
       // Automatically rotate images based on EXIF meta data: 
       'auto_orient' => true 
      ), 
      'small' => array(
       'max_width' => 150, 
       'max_height' => 150 
      ), 

      'medium' => array(
       'max_width' => 200, 
       'max_height' => 200 
      ), 

      'large' => array(
       'max_width' => 400, 
       'max_height' => 400 
      ), 

      'xlarge' => array(
       'max_width' => 600, 
       'max_height' => 600 
      ), 

      'square' => array(
       'crop' => true, 
       'max_width' => 300, 
       'max_height' => 300 
      ), 

      'thumbnail' => array(
       'max_width' => 100, 
       'max_height' => 100 
      ) 
     ) 

답변

2

난 그냥이 동일한 문제로 실행 :

이 내 코드 싹둑입니다. 코드에서 파고 들며 이미지 버전을 반복하면서 결과 이미지 객체를 캐시에 저장한다는 것을 알았습니다. 따라서 'small'이 처리 된 후에 결과 이미지 객체 (150 x 150)의 캐시 된 버전이 파일로 참조됩니다.

코드 이미지 그러나, 미리보기 이미지는 150 X 150

미만이기 때문에 처리 150 X 150 생각 때문에 이러한 소스 파일은 단순히 매체 크고 초대형 및 정방형 복사됨에 이 문제를 해결하기 위해 이미지 버전에 no_cache 옵션을 추가하면 코드 효율성이 떨어지지 만 문제는 해결됩니다.

그래서 당신의 코드는 다음과 같습니다

'image_versions' => array(
    // The empty image version key defines options for the original image: 
    '' => array(
     // Automatically rotate images based on EXIF meta data: 
     'auto_orient' => true 
    ), 
    'small' => array(
     'max_width' => 150, 
     'max_height' => 150, 
     'no_cache' => true 
    ), 

    'medium' => array(
     'max_width' => 200, 
     'max_height' => 200, 
     'no_cache' => true 
    ), 

    'large' => array(
     'max_width' => 400, 
     'max_height' => 400, 
     'no_cache' => true 
    ), 

    'xlarge' => array(
     'max_width' => 600, 
     'max_height' => 600, 
     'no_cache' => true 
    ), 

    'square' => array(
     'crop' => true, 
     'max_width' => 300, 
     'max_height' => 300, 
     'no_cache' => true 
    ), 

    'thumbnail' => array(
     'max_width' => 100, 
     'max_height' => 100, 
     'no_cache' => true 
    ) 
) 
+0

을 'no_cache => 사실은'트릭했다. 이 문제로 하루를 낭비했습니다. 마지막으로 솔루션을 찾았습니다. 고마워 :) (y) –

관련 문제