Closed philiplb closed 3 years ago
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Hello, this issue is still relevant. When uploading images with Exif data the reference is keeping the option and the image is rotated. The generated thumbnails, instead, are not rotated and upside down.
Thanks.
Can you please give some more information? E.g the used resizer and image lib (imagick, gd, ...)
Yes, of course! These are my contexts:
profile_pictures:
providers:
- sonata.media.provider.image
formats:
big: { width: 300 , quality: 85 }
For now I resolved by rotating and removing the metadata at the device (smartphone) level. But I think that the resizer should honor the exif rotate metadata.
Do you need more information?
Thanks.
IMHO it's a bug in https://github.com/avalanche123/Imagine, but feel free to investigate a little more to solve this issue.
Following this issue: https://github.com/avalanche123/Imagine/issues/190
It seems that they included an Autorotated class which should rotate the image automatically. The problem lies in the thumbnail generation?
It's a filter that does the rotation. You should include this in your config
Could you please provide a little sample about this? How can I include a filter in the config? How is the filter called?
https://sonata-project.org/bundles/media/3-x/doc/reference/advanced_configuration.html
sonata_media:
default_context: default
admin_format: { width: 200 , quality: 90, format: 'jpg'}
contexts:
default: # the default context is mandatory
download:
strategy: sonata.media.security.superadmin_strategy
mode: http
providers:
- sonata.media.provider.image
formats:
small: { width: 100 , quality: 70}
big: { width: 500 , quality: 70, resizer: sonata.media.resizer.square}
# You can pass through any custom option to resizer by using the resizer_options key
icon: { width: 32, quality: 70, resizer: your.custom.resizer, resizer_options: { custom_crop: true } }
sonata.media.resizer.simple
sonata.media.resizer.square
Sonata\MediaBundle\Resizer\ResizerInterface
sonata.media.resizer
Optional you can add the same arguments like sonata resizers by add arguments:
@sonata.media.adapter.image.default
%sonata.media.resizer.square.adapter.mode%
@sonata.media.metadata.proxy
Thanks for the example @wbloszyk, I am already using a custom resizer in my application but I don't know where can I use the autoresizer filter in it. Thanks!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hello, the issue has been closed but the problem is still present. Thanks.
There was no activity during 6 months, and when I look at answers
IMHO it's a bug in https://github.com/avalanche123/Imagine, but feel free to investigate a little more to solve this issue.
It's a filter that does the rotation. You should include this in your config
It's seems not related to SonataMedia.
But if I'm wrong, feel free to explain why and PR is welcomed.
Sonata packages
Subject
Resized images loose exif data like rotation information.
Steps to reproduce
I upload an image containing rotation information produced by the camera of a mobile device like a phone or tablet.
Expected results
The different image formats keep the meta data like the rotation.
Actual results
The different image formats loose the meta data like the rotation. The result is a correctly rotated original image but the different formats don't take the rotation into account anymore because the exif data is gone.