Skip to content
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

Fix handling invalid orientation in AutoRotateFilterLoader & test exceptions #657

Merged
merged 1 commit into from
Nov 1, 2015

Conversation

kamazee
Copy link
Contributor

@kamazee kamazee commented Oct 31, 2015

Fixes #656

@kamazee kamazee force-pushed the fix_auto_rotate_filter_loader branch 2 times, most recently from de1bf92 to a058473 Compare October 31, 2015 00:17
->expects($this->atLeastOnce())
->method('offsetGet')
->willReturn($exifValue);
if (method_exists(ImageInterface::class, 'metadata')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we still need to be 5.3 friendly

Copy link
Contributor Author

@kamazee kamazee Oct 31, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoRotateFilterLoader tried to throw an exception that didn't exist
when it had received an image with invalid EXIF orientation tag.

It also used to fall back to exif_read_data when an old Imagine was used
and it wasn't tested properly which caused breaking a build.

The test is somewhat tricky. I've added an asset with a tiny JPEG that
has an EXIF orientation tag. When an old imagine is used, test reads an
image into memory, resets the orientation byte and makes ImageInterface
mock respond with the modified image when raw JPEG is requested.
@kamazee kamazee force-pushed the fix_auto_rotate_filter_loader branch from a058473 to e84a966 Compare October 31, 2015 11:05
@lsmith77 lsmith77 merged commit e84a966 into liip:master Nov 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants