Closed wilsmex closed 10 years ago
Transforming an image in anyway will remove exif data, so setting self to true will remove the exif data, this is normal and not something I'm doing, it's just part of the image rewrite process internally.
Can you past the whole behavior configuration code so I can test locally?
That's what I was thinking. I played a bit with the settings, and now can get my full-size image to resize past 1080, but I still don't get the exif data. I've included the 'exif' transformation as per your instructions. The config file dump below doesn't give me exif data.
If I set the 'resize_large' rule to self -> false, then I do get the exif data... Very slick plugin BTW.
public $actsAs = array(
'Uploader.Attachment' => array(
'file_path' => array(
'overwrite' => false,
'stopSave' => true,
'transforms' => array(
array(
'class' => 'exif',
'self' => true // doesn't give any exif?..
),
'resize_small' => array(
'class' => 'resize',
'aspect' => true,
'overwrite' => false,
'width' => 100,
'height' => 100,
'quality' => 80,
'mode' => 'width'
),
'resize_medium' => array(
'class' => 'resize',
'aspect' => true,
'overwrite' => false,
'width' => 1080,
'height' => 1080,
'quality' => 80,
'mode' => 'width'
),
'resize_large' => array(
'class' => 'resize',
'aspect' => true,
'overwrite' => false,
'width' => 1920,
'height' => 1920,
'self' => true, //this should be true TODO with false exif data gets added.. not sure..?
'quality' => 80,
'mode' => 'width',
'expand' => false
)
),
'transport' => array(
'class' => AttachmentBehavior::S3,
'accessKey' => 'awskey',
'secretKey' => 'awssecret',
'bucket' => 'awsbucket',
'region' => Aws\Common\Enum\Region::US_EAST_1,
'folder' => IMAGE_AWS_FINAL_PATH
),
'tempDir' => TMP,
'uploadDir' => IMAGE_SITE_UPLOAD_DIR,
'finalPath' => IMAGE_FINAL_PATH,
'metaColumns' => array(
'ext' => 'file_extension',
'type' => 'file_type',
'size' => 'file_size',
'type' => 'file_type',
'basename' => 'base_name',
'name' => 'file_name',
'width' => 'width',
'height' => 'height',
'exif.make' => 'exif_make',
'exif.model' => 'exif_model',
'exif.exposure' => 'exif_exposure',
'exif.orientation' => 'exif_orientation',
'exif.fnumber' => 'exif_fnumber',
'exif.date' => 'exif_date',
'exif.iso' => 'exif_iso',
'exif.focal' => 'exif_focal'
),
'nameCallback' => 'formatUploadFileName'
)
),
'Uploader.FileValidation' => array(
'file_path' => array(
'maxWidth' => 4600,
'maxHeight' => 4600,
'minWidth' => 540,
'minHeight' => 540,
'extension' => array('gif', 'jpg', 'png', 'jpeg','mov'),
'mimeType' => array('image/gif','image/jpg','image/png','image/jpeg'),
'type' => array('image'),
'filesize' => 5242880,
'required' => false
)
)
);
It looks like I'm fetching the meta data after transforms occur, hence the exif data being missing from the original. Will have to do it before and after.
This will be fixed in the next tag.
I've got stuck on two issues, and tried a thousand configurations..
What I'm wanting: 1)Image uploads -> gets resized to 2 different thumbnails & original gets sized as well 2)Exif data gets saved 3) Bonus: is is possible to have the transform->resize 'mode' set to 'auto' where it will resize the image to the width & height that I've set according to whichever is longer?
What I'm getting: 1) Images upload, original size won't scale up past 1080px unless I set the 'expand' flag to true. (even though original image is well over 3000px on both sides..)
2) If I set the 'self' => true no exif data gets added with the image. Setting true to false, exif uploads without issues
I could be missing something obvious on my config...
Partial config dump: