Exif information get lost while preprocessing image on upload Android
I'm uploading image with preprocessing and image EXIF information gets lost, without preprocessing it is there, because of that I cannot rotate image to correct orientation.
This is my code
MediaManager.get()
.upload(absolutePath)
.preprocess(ImagePreprocessChain.limitDimensionsChain(CloudinaryConsts.PREFERED_PHOTO_SIZE, CloudinaryConsts.PREFERED_PHOTO_SIZE)
.addStep(DimensionsValidator(CloudinaryConsts.MIN_PHOTO_SIZE, CloudinaryConsts.MIN_PHOTO_SIZE, CloudinaryConsts.PREFERED_PHOTO_SIZE, CloudinaryConsts.PREFERED_PHOTO_SIZE))
.saveWith(BitmapEncoder(BitmapEncoder.Format.WEBP, CloudinaryConsts.IMAGE_QUALITY)))
.option("tags", "profile")
.option("folder", CloudinaryConsts.PROFILE_PHOTOS_FOLDER)
.option("public_id", profileUuid)
.dispatch(App.instance)
without preprocess step EXIF is there
Can I keep EXIF somehow or could I do rotation before upload
Examples:
with preprocessing: http://res.cloudinary.com/dyz7kja60/image/upload/v1531752452/profile_photos/4f548657-0ee4-483c-b892-72872864c2ed
without preprocessing: http://res.cloudinary.com/dyz7kja60/image/upload/a_ignore/v1531753661/profile_photos/4f548657-0ee4-483c-b892-72872864c2ed
-
Hi Roman,
If you add any transformation to the image, Cloudinary strips the image metadata in order to optimize the image. You can use the flag "keep_iptc" when doing the transformation and it will keep the EXIF information.
Here is more information about it: https://cloudinary.com/documentation/image_transformations#metadata_and_color_profiles_flags
-
Hi Aditi
Thank you for your reply.
In my case EXIF information gets lost while I'm uploading image not downloading, it happens on this step:preprocess(ImagePreprocessChain.limitDimensionsChain(CloudinaryConsts.PREFERED_PHOTO_SIZE, CloudinaryConsts.PREFERED_PHOTO_SIZE)
.addStep(DimensionsValidator(CloudinaryConsts.MIN_PHOTO_SIZE, CloudinaryConsts.MIN_PHOTO_SIZE, CloudinaryConsts.PREFERED_PHOTO_SIZE, CloudinaryConsts.PREFERED_PHOTO_SIZE))
.saveWith(BitmapEncoder(BitmapEncoder.Format.WEBP, CloudinaryConsts.IMAGE_QUALITY)))
Post is closed for comments.
Comments
5 comments