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

supported image types are case sensitive #25

Closed
machadoams opened this issue Dec 15, 2022 · 4 comments
Closed

supported image types are case sensitive #25

machadoams opened this issue Dec 15, 2022 · 4 comments

Comments

@machadoams
Copy link

Hi,

I am trying to calculate hash values for JPG images, but OpenImageR::readImage is case sensitive and returns an error: supported image types are .png, .jpeg, .jpg, .tiff (or .tif, .TIFF, .TIF)

I understand that modifying the file extension would work, but perhaps the readImage() function could simply ignore case sensitive in the exception for the supported image types. For example:

if (isTRUE(grepl(x = flag_type, pattern = c("jpeg|jpg"), ignore.case = TRUE))){
  img = jpeg::readJPEG(path)
}

System: R 4.2.2 on x86_64-pc-linux-gnu. OpenImageR_1.2.7 and jpeg_0.1-10.

Thanks for the great work.

@mlampros
Copy link
Owner

hi @machadoams give me some time and I'll push the changes to the repository to address this issue

@mlampros
Copy link
Owner

@machadoams I added the verify_image_extension() function. Can you install the Github version using

remotes::install_github('mlampros/OpenImageR')

and let me know if it works for you too, so that I can submit the updated version to CRAN?
Thank you for making me aware of this issue.

@mlampros
Copy link
Owner

I assume it works for you. I'll proceed and submit the new version to CRAN. Feel free to re-open the issue if the code does not work as expected

@machadoams
Copy link
Author

Hi @mlampros

It's working now! Thank you for taking the time to work on this.

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

No branches or pull requests

2 participants