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

.jpeg images raise 'NotAnImage' exception due to possible typo on base.rb #4

Open
Cathodeo opened this issue Aug 13, 2024 · 0 comments

Comments

@Cathodeo
Copy link

Issue:

A valid .jpeg image triggers the 'NotAnImage' exception, despite
.jpeg being on the list of supported extensions

Possible cause:

base.rb has the following extensions:

def extensions
@extensions ||= {
'image/png': '.png',
'image/jpeg': '.jpg',
'image/jpg': '.jpg',
'image/gif': '.gif',
'image/bmp': '.bmp',
'image/tiff': '.tif'
}
end

Which seems to expect .jpeg files to be named .jpg instead.
If ' 'image/jpeg': '.jpg' is replaced with 'image/jpeg': '.jpeg'
and the library is recompiled, the issue seems to be solved.

Might be an environment specific issue, but I could reproduce the issue with any .jpeg file prior to the edition of base.rb

(I am an absolute Junior in Ruby, so apologies if i miss some of the concepts)

@Cathodeo Cathodeo changed the title .jpeg images raise 'NotAnImage' exception due to possible type on base.rb .jpeg images raise 'NotAnImage' exception due to possible typo on base.rb Aug 13, 2024
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

1 participant