imagemin / imagemin

Minify images seamlessly
MIT License
5.57k stars 259 forks source link

CLI Jpg's not compressing #122

Closed roryashfordbentley closed 9 years ago

roryashfordbentley commented 9 years ago

Running the following from the command line compresses any pngs perfectly but it seems to ignore any jpg images and fails silently using the following command:

imagemin assets/imgs build/assets/imgs

I can confirm that the images are copied over to the destination folder but It appears that jpegtrans is failing silently as the images are identical in file size.

For testing purposes I cropped a photo down to 1000x500 and saved it out in photoshop with the maximum filesize settings. Then I placed it in the source folder as mentioned above.

Any help would be appreciated, Im sure that it is something that I have done wrong as nobody seems to be having the same issue :)

jedrichards commented 9 years ago

I think I see something similar. With default options I was seeing no change in JPG file sizes. Adding the --progressive flag seemed to do something though. Not sure if this is expected behaviour?

gbabula commented 9 years ago

I don't see any JPG compression, even with the --progressive flag.

Update - just noticed that JPEG images have some savings, JPG images however are not compressed at all.

visualcookie commented 9 years ago

Having the same issue there. JPGs won't compress properly.

shinnn commented 9 years ago

@roikles @jedrichards @gbabula @visualcookie Could you show us one of the images causing a problem?

gbabula commented 9 years ago

@shinnn

Previously, I was able to reproduce this with every image I tried (~20 attempts).

Ran a few tests now and it appears most images are reporting savings.

Not sure if there was an update in the past week, but something appears to have changed for the better :+1:


Image https://upload.wikimedia.org/wikipedia/commons/a/a0/Jaws_Beach.jpg

Input 1.3MB

Output 1.1MB


Image https://upload.wikimedia.org/wikipedia/commons/3/3e/Teddies_in_Space.jpg

Input 894KB

Output 808KB

shinnn commented 9 years ago

@gbabula Thanks for reporting.

@roikles @jedrichards @visualcookie What else?

visualcookie commented 9 years ago

Well I changed from jpegoptim to mozjpeg. Seems to work.

davidg251 commented 9 years ago

same issue here , i'm using imagemin-cli and the size of output file is the same.

shinnn commented 9 years ago

@davimba https://github.com/imagemin/imagemin/issues/122#issuecomment-142893012

davidg251 commented 9 years ago

http://imgur.com/TD8q4hu original size -> 984.3k output size -> 984.3k

$ imagemin -p 1.png media/ $ imagemin 1.png media/

same result, thanks in advance.

shinnn commented 9 years ago

@davimba Read the issue title before submitting new comments.

CLI Jpg's not compressing

I directly optimized your image with optipng. Here is the result.

$ optipng --version
OptiPNG version 0.7.5
Copyright (C) 2001-2014 Cosmin Truta and the Contributing Authors.

This program is open-source software. See LICENSE for more details.

Portions of this software are based in part on the work of:
  Jean-loup Gailly and Mark Adler (zlib)
  Glenn Randers-Pehrson and the PNG Development Group (libpng)
  Miyasaka Masaru (BMP support)
  David Koblas (GIF support)

Using libpng version 1.6.10-optipng and zlib version 1.2.5
$ optipng *.png
** Processing: TD8q4hu .png
960x720 pixels, 3x8 bits/pixel, RGB
Input IDAT size = 983864 bytes
Input file size = 984308 bytes

Trying:

TD8q4hu .png is already optimized.

That's not an imagemin-related issue.

shinnn commented 9 years ago

Closing this issue for no enough feedback on https://github.com/imagemin/imagemin/issues/122#issuecomment-143284994.