-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autorotate images based on EXIF metadata #52
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ausi
force-pushed
the
feature/exif-autorotation
branch
from
June 18, 2019 20:50
2638c48
to
2d8be88
Compare
Related pull request in |
Toflar
reviewed
Jun 25, 2019
Toflar
reviewed
Jun 25, 2019
Toflar
reviewed
Jun 25, 2019
* Insert an EXIF header into the passed JPEG data with the specified orientation. | ||
*/ | ||
private function addImageOrientation(string $jpegData, int $orientation): string | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the next rewiever: there‘s no PHP exif function that allows to write this data.
leofeyer
reviewed
Jul 2, 2019
leofeyer
approved these changes
Jul 2, 2019
leofeyer
pushed a commit
to contao/contao
that referenced
this pull request
Jul 3, 2019
Description ----------- Depends on ~~contao/image#52 and ~~#537~~ As discussed in contao/image#44 (comment) we want to automatically rotate images if they have an EXIF IFD0-Orientation tag. Because lighbox images now run through the resizer too I added a ~~`contao.image.lightbox_size` configuration~~ `lightboxSize` layout setting where you can define the (maximum) size of your lightbox images. This can be overwritten by providing an `$arrItem['lightboxSize']` to the `addImageToTemplate()` method. I also added a ~~`contao.image.force_re_encoding` configuration~~ `skipIfDimensionsMatch` flag to the image size settings, this might be useful to get the benefits of resizing (like to-RGB-conversion, interlacing, metadata-stripping, sampling factors and specific JPEG-quality) even if no resize is required. (Related: contao/core-bundle#636) ~~Any opinions on the naming of `lightbox_size` and `force_re_encoding`?~~ Commits ------- 51c1fd6 Autorotate images based on EXIF metadata 3798184 Add contao.image.lightbox_size configuration 39b3cef Add image.force_re_encoding configuration 4fb9ea2 Use the autorotation branch of contao/image 6fc4dba Fix tests a6d92a2 Move force_re_encoding flag to size configuration 689fd3e Move lightbox_size to layout configuration 3e0fb0f Add translation messages bae425f Improve skipIfDimensionsMatch description cb6395e Fix phpstan issues c3b981b Add $arrItem['lightboxSize'] parameter 32cffec Fix composer.json f247946 Fix typo aa83d03 Rename forceReEncoding to inverted skipIfDimensionsMatch ee41741 Use 1.0.0-beta2 version of contao/image 14433cf Add skipIfDimensionsMatch to predefined sizes 5ec5af1 Remove leftover lightbox_size configuration 610264d Fix issues from rebase aea51f4 Fix the coding style
leofeyer
pushed a commit
to contao/core-bundle
that referenced
this pull request
Jul 3, 2019
Description ----------- Depends on ~~contao/image#52 and ~~#537~~ As discussed in contao/image#44 (comment) we want to automatically rotate images if they have an EXIF IFD0-Orientation tag. Because lighbox images now run through the resizer too I added a ~~`contao.image.lightbox_size` configuration~~ `lightboxSize` layout setting where you can define the (maximum) size of your lightbox images. This can be overwritten by providing an `$arrItem['lightboxSize']` to the `addImageToTemplate()` method. I also added a ~~`contao.image.force_re_encoding` configuration~~ `skipIfDimensionsMatch` flag to the image size settings, this might be useful to get the benefits of resizing (like to-RGB-conversion, interlacing, metadata-stripping, sampling factors and specific JPEG-quality) even if no resize is required. (Related: #636) ~~Any opinions on the naming of `lightbox_size` and `force_re_encoding`?~~ Commits ------- 51c1fd67 Autorotate images based on EXIF metadata 3798184e Add contao.image.lightbox_size configuration 39b3cef1 Add image.force_re_encoding configuration 4fb9ea21 Use the autorotation branch of contao/image 6fc4dba0 Fix tests a6d92a23 Move force_re_encoding flag to size configuration 689fd3ed Move lightbox_size to layout configuration 3e0fb0fb Add translation messages bae425f4 Improve skipIfDimensionsMatch description cb6395e5 Fix phpstan issues c3b981b9 Add $arrItem['lightboxSize'] parameter 32cffecd Fix composer.json f247946b Fix typo aa83d030 Rename forceReEncoding to inverted skipIfDimensionsMatch ee41741d Use 1.0.0-beta2 version of contao/image 14433cfa Add skipIfDimensionsMatch to predefined sizes 5ec5af10 Remove leftover lightbox_size configuration 610264da Fix issues from rebase aea51f4d Fix the coding style
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in #44 (comment) we want to automatically rotate images if they have an EXIF IFD0-Orientation tag.
I also added a
force-re-encoding
flag that might be useful to get the benefits of resizing (like to-RGB-conversion, interlacing, metadata-stripping, sampling factors and specific JPEG-quality) even if no resize is required. (cc @agoat)ToDo
forceReEncoding
the correct name for this flag?reEncodeImageEvenIfNoResizeIsRequired
seems too long 😉