You need to sign in to do that
Don't have an account?
Jessi McPeek
How to tell if image has been rotated by Salesforce File (Content Version) Object
I have users attaching images that are to be pushed through an API to an outside website. We are currently attaching the images as files in the related list to our custom object. However these files will sometimes auto rotate on the view so they appear to be uploaded in the correct orientation (for example a picture of a person is showing in portrait, but is saved as a landscape), but when the file is downloaded it is showing in the landscape orientation, making it push to our outside site as a landscape photograph. We are accessing the image through the content version object.
Is there a way to tell if the view of the image is different than the original file orientation?
Is there a way to change the orientation of the image programmaticaly so that is is stored in the correct orientation?
Is there a way to tell if the view of the image is different than the original file orientation?
Is there a way to change the orientation of the image programmaticaly so that is is stored in the correct orientation?
for(ContentDocumentLink doclink : [select id, ContentDocumentId from contentdocumentlink where LinkedEntityId = :sObject.id Limit 1]) { for(ContentDocument img : [Select id, title, fileExtension, Createddate from ContentDocument where id =:doclink.ContentDocumentId and (fileExtension = 'jpg' or fileExtension = 'jpeg'or fileExtension ='png' or fileExtension = 'gif') order by CreatedDate asc Limit 1]) { for(ContentVersion version : [Select versionData, PathOnClient from contentVersion where ContentDocumentId =: img.id]) { Blob image = version.versionData; } } }
We are facing same issue.
Did you find any solution for these?
Thanks in advance.