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 file types are case sensitive #181

Closed
jamesstout opened this issue Sep 15, 2019 · 2 comments
Closed

Supported file types are case sensitive #181

jamesstout opened this issue Sep 15, 2019 · 2 comments

Comments

@jamesstout
Copy link
Contributor

Steps To Reproduce The Error

A dir with *.PNG files:

james@Jamess-iMac: ~/Desktop/project-burrito
$ ll
total 203008
-rwxrwxrwx@ 1 james  staff  11865040 Feb 26  2019 IMG_4111.PNG
-rwxrwxrwx@ 1 james  staff   6949340 Jun 20 18:50 IMG_4413.PNG
-rwxrwxrwx@ 1 james  staff  14562646 Jun 20 18:49 IMG_4488.PNG
-rwxrwxrwx@ 1 james  staff   7283045 Jun 20 18:49 IMG_4558.PNG
-rwxrwxrwx@ 1 james  staff   7448514 Jun 20 18:49 IMG_4564.PNG
-rwxrwxrwx@ 1 james  staff   9694620 Jun 20 18:49 IMG_4609.PNG
-rwxrwxrwx@ 1 james  staff   8287775 Jun 20 18:49 IMG_4709.PNG
-rwxrwxrwx@ 1 james  staff  13382413 Jun 20 18:48 IMG_4771.PNG
-rwxrwxrwx@ 1 james  staff   8238668 Jun 20 18:46 IMG_5013.PNG
-rwxrwxrwx@ 1 james  staff   8226910 Jun 20 18:46 IMG_5090.PNG
-rwxrwxrwx@ 1 james  staff   7977126 Jun 20 18:46 IMG_5122.PNG

Expected Behaviour

imageoptim should find the *.PNG files and process them. --help says:

Run ImageAlpha.app and ImageOptim.app over every PNG in current directory
imageoptim --imagealpha '**/*.png'

This command doesn't find files with an uppercase extension.

Actual Behaviour

james@Jamess-iMac: ~/Desktop/project-burrito
$ imageoptim --imagealpha '**/*.png'
! No images matched the patterns provided

james@Jamess-iMac: ~/Desktop/project-burrito
$ imageoptim --imagealpha '**/*.PNG'
! No images matched the patterns provided

If I rename, then it works:

james@Jamess-iMac: ~/Desktop/project-burrito
$ for file in *.PNG
> do
> mv "$file" "${file%.PNG}.png"
> done

james@Jamess-iMac: ~/Desktop/project-burrito
$ ll
total 203008
-rwxrwxrwx@ 1 james  staff  11865040 Feb 26  2019 IMG_4111.png
-rwxrwxrwx@ 1 james  staff   6949340 Jun 20 18:50 IMG_4413.png
-rwxrwxrwx@ 1 james  staff  14562646 Jun 20 18:49 IMG_4488.png
-rwxrwxrwx@ 1 james  staff   7283045 Jun 20 18:49 IMG_4558.png
-rwxrwxrwx@ 1 james  staff   7448514 Jun 20 18:49 IMG_4564.png
-rwxrwxrwx@ 1 james  staff   9694620 Jun 20 18:49 IMG_4609.png
-rwxrwxrwx@ 1 james  staff   8287775 Jun 20 18:49 IMG_4709.png
-rwxrwxrwx@ 1 james  staff  13382413 Jun 20 18:48 IMG_4771.png
-rwxrwxrwx@ 1 james  staff   8238668 Jun 20 18:46 IMG_5013.png
-rwxrwxrwx@ 1 james  staff   8226910 Jun 20 18:46 IMG_5090.png
-rwxrwxrwx@ 1 james  staff   7977126 Jun 20 18:46 IMG_5122.png

james@Jamess-iMac: ~/Desktop/project-burrito
$ imageoptim --imagealpha '**/*.png'
i Running ImageAlpha...
i Running ImageOptim...
✓ IMG_4111.png was: 11.9MB now: 1.04MB saving: 10.8MB (91.24%)
---8<---8<---snip---8<---8<---8<---8<
✓ TOTAL was: 104MB now: 8.76MB saving: 95.2MB (91.57%)
✓ Finished

Version Numbers or N/A

  • macOS: 10.13.6 (17G8030)
  • /Applications/ImageOptim.app: 1.8.8
  • /Applications/ImageAlpha.app: 1.5.1
  • /Applications/JPEGmini.app: NA
$ bash --version
GNU bash, version 5.0.11(1)-release (x86_64-apple-darwin17.7.0)

Also, my filesystem is case-insensitive:

$ diskutil info / | grep Personality
   File System Personality:  APFS

Available APFS personalities:

$ diskutil listFilesystems | grep APFS
APFS                            APFS
  (or) APFSI
Case-sensitive APFS             APFS (Case-sensitive)

Help Needed

Do we add uppercase file types to the supports hash? (or map or indexable object or whatever it's called in TypeScript) - seems a bit hacky.

Or use .toLowerCase() somewhere? Maybe in the extname() call in is-supported.ts

[I'm trying this out in my fork, but, the nexe compiled bin just exits:

james@Jamess-iMac: ~/tmp/ImageOptim-CLI/dist on master[!]
$ ./imageoptim
Killed: 9

Can you run/debug without building with nexe?

@JamieMason
Copy link
Owner

Can you run/debug without building with nexe?

Sorry, try this @jamesstout to skip Nexe

npm run build:ts
node dist/imageoptim.js --help

@JamieMason
Copy link
Owner

Fix available and will be in the next release.

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