views:

41

answers:

1

Hi

I'm using this MeioUpload Behavior. And i installed both phpThumb component and phpThumb vendor.

Thumbnail generation is working fine but zoom-cropping is not. Here is my code. You can see i've tried every possible variables. I also set every default zc or zoom_crop variables I found in component and vendor to 1. 1 is the same as C anyway.


var $actsAs = array('MeioUpload' => array(  'filename' => array(
   'dir' => "uploads/images",
   'create_directory' => true,
   'allowed_mime' => array('image/jpeg', 'image/pjpeg', 'image/gif', 'image/png'),
   'allowed_ext' => array('.jpg', '.jpeg', '.png', '.gif'),
   'thumbsizes' => array(
       'small'  => array('width'=>65, 'height'=>60,'zc'=>"C", 'zoomCrop' => "C", 'zoom_crop'=>"C"),
       'medium' => array('width'=>159, 'height'=>130, 'zc'=>"C", 'zoomCrop' => "C", 'zoom_crop'=>"C"),
       'large'  => array('width'=>480, 'height'=>320,'zc'=>"C",  'zoomCrop' => "C", 'zoom_crop'=>"C")
   )
  )
   )
 );

Any idea?

A: 

Ok, I gave up the use of MeioUpload to generate-and-save thumbnails. Instead, I generate thumbnails on-the-fly, directly using phpThumb. Like this

<img src="<?=$this->webroot?>phpThumb/phpThumb.php?src=../uploads/images/<?=$event['Image'][0]['filename']?>&w=159&h=130&zc=1" alt="Event Picture">

It's a little sacrifice for performance but every easy and flexible.

Moe Sweet