silverstripe / silverstripe-assets

Silverstripe Assets component
BSD 3-Clause "New" or "Revised" License
10 stars 67 forks source link

Images rendered in the asset admin interface are incorrectly orientated #36

Open dhensby opened 7 years ago

dhensby commented 7 years ago

When uploading images to the asset admin the orientation can be incorrect as the exif data is not taken into account. For example, when uploading the images from https://github.com/recurser/exif-orientation-examples the following is shown:

CMS thumbnails

NB: They are correctly orientated when loaded in the side view so this appears to be a client side issue. The images are not correctly orientated on reload after initial upload either.

Perhaps integrating with https://github.com/blueimp/JavaScript-Load-Image may be worthwhile for resolving orientation issues in the CMS?

chillu commented 7 years ago

Oh, the fun never stops in JavaScript, does it? We're using style: background-image(<data-uri>) for unpublished images in the previews, which likely strips EXIF metadata. See https://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/ for details.

dhensby commented 7 years ago

Is that data-uri a full encode of the original image or is it an encode of the CMSThumbnail? because the new image backend orientates images correctly now, so as long as they are generated from a resampled image they should "just work"...

However, when the images are initially uploaded I assume this is done from the local file - at that point we can/should orientate correctly.

dhensby commented 7 years ago

Also maybe we need an ability to rotate images in the CMS ;)

kinglozzer commented 7 years ago

Closed in https://github.com/silverstripe/silverstripe-assets/pull/34

kinglozzer commented 7 years ago

... or not, original issue says client side 😅