Skip to content
This repository has been archived by the owner on Sep 11, 2022. It is now read-only.

Resize the picture of the high deflection #21

Closed
sb122k opened this issue Oct 16, 2014 · 4 comments
Closed

Resize the picture of the high deflection #21

sb122k opened this issue Oct 16, 2014 · 4 comments

Comments

@sb122k
Copy link

sb122k commented Oct 16, 2014

use:resize.Resize(100, 0, img, resize.Lanczos3)

sourece pic:
image

out pic:
image

Rotated 90 degrees, why

thanks

@nfnt
Copy link
Owner

nfnt commented Oct 17, 2014

Sorry, I'm unable to reproduce this using your input image and these parameters. My output picture is not rotated. Are you using the latest commit of this package?
Internally the resizing algorithm has 2 steps: It scales horizontally then scales vertically. It seems that in your case the resizing stops after the first step. But there's no condition in the source code that would do that. Therefore I would need some more information on what's going on in your case.

@ukautz
Copy link

ukautz commented Oct 31, 2014

I can confirm the issue with JPEG images. However, at least with JPEGs, I think it's rather an EXIF issue.

Here is the original: http://pbrd.co/1q7lyW8
And here the thumbnail: http://pbrd.co/1q7ljKK

Looking at them in the browser -> both are rotated the same. However: the large one contains an EXIF Orientation flag saying Left-bottom. Every program (image editing, file browser, ..) which supports EXIF will display it rotated. My file browser (thunar, Linux) and the one from Apple both support EXIF in file preview. You should be able to confirm this by downloading both and either looking at them in your file browser preview or most image editing programs.. Anyhow: when processing the image with this library, it "seems" like a bug.. until you dig deeper.

So not sure if this classifies as a real bug, but it would be neat if one could keep the EXIF Orientation flag - or being able to set it (again: might not be the duty of a resize library).

@nfnt
Copy link
Owner

nfnt commented Nov 8, 2014

Right, the Go image package does not import/export EXIF metadata, therefore every information included in that data will be lost (see #13). A separate package would be necessary to handle metadata.
@sb122k: Can you confirm that the issue might be caused by an Orientation flag in the EXIF data?
I will close this ticket. If there is any indicator that the issue is caused by something different than EXIF data, I'll reopen it.

@nfnt nfnt closed this as completed Nov 8, 2014
@sb122k
Copy link
Author

sb122k commented Dec 23, 2014

sorry, long time no attention to this issue, I confirm that is the reason

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants