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

Meta from image with exif rotation #949

Closed
pscheit opened this issue Jul 23, 2017 · 7 comments
Closed

Meta from image with exif rotation #949

pscheit opened this issue Jul 23, 2017 · 7 comments

Comments

@pscheit
Copy link

pscheit commented Jul 23, 2017

Thumbor request URL

http://192.168.99.100:8000/unsafe/meta/fit-in/620x620/filters:quality(75)/my/image/imgp9768.jpg
EXIF data:

Filename - imgp9768.jpg
Make - PENTAX Corporation 
Model - PENTAX K10D        
Orientation - Right top
XResolution - 72
YResolution - 72
ResolutionUnit - Inch
Software - K10D Ver 1.00
DateTime - 2016:12:28 16:17:32
YCbCrPositioning - Co-Sited
ExifOffset - 598
ExposureTime - 1/30 seconds
FNumber - 2.80
ExposureProgram - Normal program
ISOSpeedRatings - 400
ExifVersion - 0221
DateTimeOriginal - 2016:12:28 16:17:32
DateTimeDigitized - 2016:12:28 16:17:32
ComponentsConfiguration - YCbCr
ExposureBiasValue - 0.50
MeteringMode - Multi-segment
Flash - Flash not fired, compulsory flash mode
FocalLength - 19.00 mm
FlashPixVersion - 0100
ColorSpace - sRGB
ExifImageWidth - 3872
ExifImageHeight - 2592
InteroperabilityOffset - 46036
SensingMethod - One-chip color area sensor
FileSource - Other
SceneType - Other
CustomRendered - Normal process
ExposureMode - Manual
White Balance - Auto
FocalLengthIn35mmFilm - 28 mm
SceneCaptureType - Standard
Contrast - Normal
Saturation - Normal
Sharpness - Normal
SubjectDistanceRange - Macro

Maker Note (Vendor): - 
Mode - Auto
Quality - Best
ISO - 500
White Balance - Auto
Lens Type - Sigma AF 10-20mm F4-5.6 EX DC

Thumbnail: - 
Compression - 6 (JPG)
XResolution - 72
YResolution - 72
ResolutionUnit - Inch
JpegIFOffset - 46160
JpegIFByteCount - 6382

Expected behaviour

The meta data should report the new dimensions from the rotated image.
(415px x 620px)

Actual behaviour

The meta data reports the dimensions of the image BEFORE it was rotated
(620px x 415px)
When I remove "meta" the image is correctly fitted in and turned correctly. EXIF Information is also correct.

{
	"thumbor": {
		"operations": [{
			"width": 620.0,
			"type": "resize",
			"height": 415.0
		}],
		"source": {
			"url": "my/image/imgp9768.jpg",
			"width": 3872,
			"frameCount": 1,
			"height": 2592
		},
		"focal_points": [{
			"origin": "alignment",
			"height": 1,
			"width": 1,
			"y": 1296.0,
			"x": 1936.0,
			"z": 1.0
		}],
		"target": {
			"width": 620.0,
			"height": 415.0
		}
	}
}

Operating system

Linux (Docker)

Your thumbor.conf

RESPECT_ORIENTATION=True

Is it my fault? or a bug?

Thank you so much for writing thumbor!
Philipp

@heynemann
Copy link
Member

It is a bug, but I'm not sure when I can go and fix it. Any chance you can help with a PR?

@pscheit
Copy link
Author

pscheit commented Nov 16, 2017

mhh. I'm a real python noob and got no infrastructure to code and test python projects. I would think I would break everything if I'll fix it :D
But the bug isn't affecting my production right now, so let's see who will got time to fix it first.
thanks!

@pscheit
Copy link
Author

pscheit commented Aug 3, 2018

@heynemann do you think you can spend some time on this?

https://github.com/recurser/exif-orientation-examples

@pscheit
Copy link
Author

pscheit commented Nov 3, 2018

Would you agree, that the meta data for the original of the image (with an exif-Orientation Tag != 1) would still be the physical size of the original image (e.g. not rotated)

And the meta data for a thumbnailed/resized/whatever changed (and exif stripped) image is then rotated, when RESPECT_ORIENTATION=True ?

@cristiandean
Copy link
Contributor

@pscheit Can you try my solution to see if it solves your problem?

@pscheit
Copy link
Author

pscheit commented Nov 5, 2018

LGTM

@caeugusmao
Copy link
Contributor

caeugusmao commented Nov 5, 2018

@pscheit Fix on PR #1131! ;)

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

No branches or pull requests

4 participants