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

Inability to save files with .jpeg extension #929

Closed
kikiotsuka opened this Issue Jul 23, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@kikiotsuka

kikiotsuka commented Jul 23, 2015

.jpeg and .jpg file extensions are interchangeable, yet SFML does not seem to support saving .jpeg extensions. Noteworthy in this code segment https://github.com/SFML/SFML/blob/master/src/SFML/Graphics/ImageLoader.cpp#L253 SFML doesn't check for a .jpeg extension. I would like to propose a minor bugfix for simply allowing files with a .jpeg extension to be saved in the exact same manner as a .jpg

@MarioLiebisch

This comment has been minimized.

Show comment
Hide comment
@MarioLiebisch

MarioLiebisch Jul 23, 2015

Member

Good catch. Although the whole "extension detection" as-is is quite a bit naive. For example, test.coolpng or even some_png would still be interpreted as a PNG image since it's longer than 3 characters and ends with png. But this is obviously wrong. Going to create a patch, thanks anyway. :)

Member

MarioLiebisch commented Jul 23, 2015

Good catch. Although the whole "extension detection" as-is is quite a bit naive. For example, test.coolpng or even some_png would still be interpreted as a PNG image since it's longer than 3 characters and ends with png. But this is obviously wrong. Going to create a patch, thanks anyway. :)

@TankOs

This comment has been minimized.

Show comment
Hide comment
@TankOs

TankOs Jul 23, 2015

Member

I think we should really search for '.' from the end, extract the extension and then check, @MarioLiebisch. This bug might be a good opportunity to change it. @kikiotsuka thanks for reporting!

Member

TankOs commented Jul 23, 2015

I think we should really search for '.' from the end, extract the extension and then check, @MarioLiebisch. This bug might be a good opportunity to change it. @kikiotsuka thanks for reporting!

@kikiotsuka

This comment has been minimized.

Show comment
Hide comment
@kikiotsuka

kikiotsuka Jul 23, 2015

@TankOs do you mind giving me another shot? I redid that section of the code here #930 (Ignore the thing above I made a mistake)

kikiotsuka commented Jul 23, 2015

@TankOs do you mind giving me another shot? I redid that section of the code here #930 (Ignore the thing above I made a mistake)

MarioLiebisch added a commit that referenced this issue Jul 23, 2015

Fixed image file extension detection
Previously this would fail on `jpeg` and would detect something such as
`notajpg` as `jpg`. This fixes #929.
@Bromeon

This comment has been minimized.

Show comment
Hide comment
@Bromeon

Bromeon Jul 23, 2015

Member

Next time, please read the contribution guidelines first. This helps us organize things better -- it's not necessary to have 3 open issues/PRs for the same thing. Thanks.

Let's continue the discussion in #931, otherwise it gets confusing ;)
I'll close this so we have one issue/PR per task.

Member

Bromeon commented Jul 23, 2015

Next time, please read the contribution guidelines first. This helps us organize things better -- it's not necessary to have 3 open issues/PRs for the same thing. Thanks.

Let's continue the discussion in #931, otherwise it gets confusing ;)
I'll close this so we have one issue/PR per task.

@Bromeon Bromeon closed this Jul 23, 2015

@Bromeon Bromeon added s:superseded and removed s:accepted labels Jul 23, 2015

MarioLiebisch added a commit that referenced this issue Aug 12, 2015

Fixed image file extension detection
Previously this would fail on `jpeg` and would detect something such as
`notajpg` as `jpg`. This fixes #929.

MarioLiebisch added a commit that referenced this issue Aug 12, 2015

Fixed image file extension detection
Previously this would fail on `jpeg` and would detect something such as
`notajpg` as `jpg`. This fixes #929.

zsbzsb added a commit to zsbzsb/SFML that referenced this issue Sep 19, 2015

Fixed image file extension detection
Previously this would fail on `jpeg` and would detect something such as
`notajpg` as `jpg`. This fixes SFML#929.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment