WordPress.org

Ready to get started?Download WordPress

Forums

EWWW Image Optimizer
[resolved] optipng, pngout missing - but not really. (8 posts)

  1. JS Morisset
    Member
    Posted 1 year ago #

    I'm getting errors that I shouldn't:

    "EWWW Image Optimizer requires jpegtran, optipng or pngout, and gifsicle. You are missing: optipng, pngout. Please install via the Settings Page. If the one-click install links don't work for you, try the Installation Instructions."

    and:

    "EWWW Image Optimizer couldn't install optipng and gifsicle in /export/www/trtms/wordpress/wp-content/ewww/. Please adjust permissions or create the folder."

    They're all there:

    $ locate optipng pngout jpegtran gifsicle | grep bin
    /usr/bin/gifsicle
    /usr/bin/jpegtran
    /usr/bin/optipng
    /usr/local/bin/pngout
    /usr/local/bin/pngout-static

    I even added them to the ewww directory (though the PATH should be enough):

    wordpress/wp-content/ewww$ ls -al
    total 8
    drwxrwsr-x  2 apache surniaulula 4096 Dec 29 18:55 .
    drwxrwsr-x 11 apache surniaulula 4096 Dec 29 18:53 ..
    lrwxrwxrwx  1 root   surniaulula   17 Dec 29 18:54 gifsicle -> /usr/bin/gifsicle
    lrwxrwxrwx  1 root   surniaulula   17 Dec 29 18:54 jpegtran -> /usr/bin/jpegtran
    lrwxrwxrwx  1 root   surniaulula   16 Dec 29 18:55 optipng -> /usr/bin/optipng
    lrwxrwxrwx  1 root   surniaulula   21 Dec 29 18:55 pngout -> /usr/local/bin/pngout

    Thanks,

    js.

    http://wordpress.org/extend/plugins/ewww-image-optimizer/

  2. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    pngout SHOULD be easy enough, just copy pngout-static to the 'ewww' folder. It doesn't look anywhere else for it, and the validation fails when using symlinks.

    At any rate, the plugin is going to keep nagging you until you either change permissions on the 'ewww' folder or copy the bundled versions of gifsicle and optipng into the 'ewww' folder (no symlinks, it does a filesize comparison).

    Regardless of the 'nagging' it will still fall back to system paths for everything but pngout, so I'm not sure why optipng is giving you trouble. Can you do ls -l /usr/bin/optipng and see what the permissions are? Make sure it is readable and executable for all users (should see 3 x's and 3 r's regardless of the w's). Additionally, could you clarify what optipng binary is at /usr/bin/optipng? Is it the one I provided, or did you install the system-provided one via apt-get or yum or some other package manager?

  3. JS Morisset
    Member
    Posted 1 year ago #

    The permissions:

    wordpress/wp-content/ewww$ ls -l
    total 0
    lrwxrwxrwx 1 root     surniaulula 17 Dec 29 18:54 gifsicle -> /usr/bin/gifsicle
    lrwxrwxrwx 1 root     surniaulula 17 Dec 29 18:54 jpegtran -> /usr/bin/jpegtran
    lrwxrwxrwx 1 root     surniaulula 16 Dec 29 18:55 optipng -> /usr/bin/optipng
    lrwxrwxrwx 1 root     surniaulula 21 Dec 29 18:55 pngout -> /usr/local/bin/pngout
    lrwxrwxrwx 1 jsmoriss surniaulula 28 Dec 30 13:13 pngout-static -> /usr/local/bin/pngout-static
    wordpress/wp-content/ewww$ ls -lL
    total 1152
    -rwxr-xr-x 1 root root 147430 Jun  8  2012 gifsicle
    -rwxr-xr-x 1 root root  25552 Jan  6  2007 jpegtran
    -rwxr-xr-x 1 root root 148696 Apr 20  2010 optipng
    -rwxr-xr-x 1 root root  91904 Nov 28 21:26 pngout
    -rwxr-xr-x 1 root root 739504 Nov 28 21:28 pngout-static

    Since the plugin does a compare, I also linked them from the plugin folder:

    wordpress/wp-content/plugins/ewww-image-optimizer$ ls -l | grep ^l
    lrwxrwxrwx 1 jsmoriss surniaulula     17 Dec 30 13:13 gifsicle -> /usr/bin/gifsicle
    lrwxrwxrwx 1 jsmoriss surniaulula     17 Dec 30 13:15 jpegtran -> /usr/bin/jpegtran
    lrwxrwxrwx 1 jsmoriss surniaulula     16 Dec 30 13:14 optipng -> /usr/bin/optipng
    lrwxrwxrwx 1 jsmoriss surniaulula     21 Dec 30 13:15 pngout -> /usr/local/bin/pngout
    lrwxrwxrwx 1 jsmoriss surniaulula     28 Dec 30 13:15 pngout-static -> /usr/local/bin/pngout-static

    That took care of the first warning (EWWW Image Optimizer requires jpegtran, optipng or pngout, and gifsicle. You are missing: optipng, pngout. Please install via the Settings Page. If the one-click install links don't work for you, try the Installation Instructions.).

    Then I checked the "Skip utils check" option and that took care of the second warning (EWWW Image Optimizer couldn't install optipng and gifsicle in /export/www/trtms/wordpress/wp-content/ewww/. Please adjust permissions or create the folder.).

    So, all good until the next upgrade.

    BTW, you may want to rethink the idea of deploying binaries with the plugin -- forcing people to use pre-compiled binaries from an unverified source is just bad practice.

    Thanks,

    js.

  4. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    Well, to be honest, it doesn't really 'force' you to use the bundled binaries, it only nags you to install them in the 'ewww' folder. You could change them to be non-executable after they get copied over, and then it should just use the system installed ones.

    The main reason the plugin prefers the bundled version is because the system binaries are likely to be out of date (gifsicle, jpegtran) or missing security patches (optipng).

    All that said, user-feedback like yours is valuable and I think a couple things could be better then:

    1. Have a checkbox to use system installed binaries instead of bundled ones (instead of the skip utils check, which is deprecated and will go away in a month or two).

    2. Make the plugin check for pngout in system-paths. While I've been trying to cater more to the novice user with the latest developments, I've forgotten there are actually people who do know what they are doing and are capable of installing binaries properly.

  5. JS Morisset
    Member
    Posted 1 year ago #

    Yup, that would be great. And although it might be a little more work, maybe you could check the version of available binaries from the PATH and suggest the admin upgrade (or use those you've shipped with the plugin) if they are too old? I'm thinking you might approach the whole binary thing as a 'dependency' -- check for already installed binaries from the PATH, and check their version numbers. If the dependency fails, THEN suggest they either install the package(s), or the binaries available in your plugin directory.

    And maybe this is a preference thing, but I find that plugins create way too many tempary/cache/working directories under the wordpress folder. As we've seen with W3TC recently, keeping those folders secure can be an issue (the wordpress folder is a DocumentRoot after all). On my server, for example, ALL files under the wordpress folder are 664 (group and perms verified and corrected automatically). I had to create an exception for your wp-content/ewww/ folder.

    Anyway, just my 2 cents. ;-) I still think you've got a great plugin. ;-)

    BTW, I'm using a script called wesley.pl to process the NGG gallery/cache/ folder:

    http://surniaulula.com/2012/12/29/wesley-pl-optimize-script-for-jpeg-png-and-gif/

    You might want to consider offering the option of choosing the -copy value for jpegtran. For example, I don't mind dropping EXIF for thumbnails, but want to keep it for larger images.

    Thanks,

    js.

  6. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    There is an option to remove EXIF (the -copy option) with jpegtran near the bottom of the settings page, although now that I'm thinking about it, those advanced settings should probably be nearer to the top. It is off by default (or should be), so folks don't unwittingly flush all their EXIF data down the drain.

    I was thinking that along with the option to use system-paths, option #1 from my previous post would also cause the plugin to skip the (currently) mandatory binary installs as well, so the ewww folder would not be strictly necessary, and you wouldn't be nagged until you created it.

    Also, I agree that it would be nice to show a warning when the binaries are not up-to-date.

  7. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    Oh, I was also going to check metadata on thumbnails. It does appear that thumbnails get a bit of metadata, but not much to worry about (61 B on a 2.5 MB original).

  8. nosilver4u
    Member
    Plugin Author

    Posted 1 year ago #

    Just found the optipng error while I was working on some of this. Older versions of optipng output a slightly different version string than the one I was checking for. That'll be fixed shortly...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.