Support » Plugin: CW Image Optimizer » [Plugin: CW Image Optimizer] "Unknown type" and "Bad response"

  • Hi!

    So I’m testing this out. I do not know if littleutils is installed on my shared server, but I thought I’d try it, and I assumed that you rplugin would do a check for it and let me know if it wasn’t. As I did not get a warning or message from the plugin, I tried to optimize one image (I tried a png and a jpg). it didn’t work.

    For the png, it says “Unknown type: text/plain”

    for the jpg, it says “Bad response from optimizer”

    I guess this means that the littleutils is not installed on my shared server? maybe a quick check somehow would be useful, upon activation of the plugin?


Viewing 15 replies - 1 through 15 (of 25 total)
  • Plugin Author Jacob Allred


    Thanks for the feedback.

    The latest version, 1.1.1, does check if the required utilities are available and if not it displays a warning message at the top of the admin pages.

    For the PNG error, sounds like your PNG file is either not a valid PNG file, or your installation of PHP is returning the incorrect MIME type for the file.

    littleutils is not a standard package that most servers have. You’ll probably need to install it before this plugin will work for you. It takes a little more effort to get going than WP, but if you don’t want your images uploaded to a third party (I sure don’t) then it is worth it.

    Thanks for updating the plguin. I had installed it this morning, so good wok on updating it quickly!

    My server doesn’t have littleutils installed (confirmed by your plugin), so I’ve asked my shared host to install it for me.

    As for the MIME types, that’s really strange, as they are set correctly as far as I can tell. Anyway, I’ll try again once my host installs littleutils. I’ll leave this as “not resolved” for now, and I’ll update when I can.


    So I asked my host to install it, and they did. However, I get this message on my dashboard:

    “CW Image Optimizer requires littleutils. You are missing: opt-png, opt-jpg, opt-gif.”

    I asked my host if these were things that needed to be turned on by them or something, and they said the following:

    “Can you specify the path to littleutils? if so, please use /usr/local/lib/littleutils”

    I don’t see anywhere in your code a place to specify the path, and to be honest, I’m not even clear on how it is that you actually check for it being installed (I’m intermediate-level in PHP; I read through your code and could follow most of it, but didn’t see exactly how you check).

    Also, when I go to my library, beside png files I get “Unsupported file type”, and beside jpg files I get “Unsupported file type
    opt-jpg is missing”

    So now what? Any suggestions?


    What is the differences between size reduction and image quality between smush it and this littleutils for linux ?

    Simply put which is better in these 2 areas ?

    Also is there going to be a guide how to install/setup the dependency needed for this plugin ?

    Plugin Author Jacob Allred


    @richardmtl – littleutils provides several little utilities. The ones required by this plugin are opt-jpg, opt-gif, and opt-png. The plugin expects them to be in the PATH, which is done by default when littleutils is installed.

    @moogle Stiltzkin – Both this plugin and WP provide lossless optimization, meaning the image quality will be exactly the same before and after the optimization.

    However, CW Image Optimizer will often provide smaller file sizes (just a little bit smaller) because it tries more methods of optimization than WP

    I’m working on a guide for installing littleutils on the most common Linux distributions, but it isn’t finished yet. Most people familiar with installing software on Linux will be able to do it without, as littleutils follows the standard configure/make/make install pattern of installing software.

    Basically you download package and run the following commands in the directory that has the littleutils-1.0.24.tar.bz2 file:

    1. tar jxvf littleutils-1.0.24.tar.bz2
    2. cd littleutils-1.0.24
    3. ./configure
    4. make
    5. make install
    6. make install-extra

    littleutils itself has a few dependencies, such as gifsicle, pngcrush, and lzma. These are generally available from the package manager used in most Linux distributions. I’ll include instructions on installing these in my install guide.

    Plugin Author Jacob Allred


    The installation instructions have been updated to include step-by-step instructions for CentOS and Ubuntu. Hope this helps!


    I gave your PATH instructions to my host, and he sent back the following:

    “Please send this to the developer

    echo $PATH
    /usr/local/jdk/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/courier imap/sbin:/usr/lib/courier-imap/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin::/usr/bin:/usr/local/bin:/usr/X11R6/bin:/root/bin

    So.. now what?

    Plugin Author Jacob Allred


    The utilities are normally installed in /usr/local/bin, which is listed in the path provided by your host.

    It is possible that the user that PHP is running as on your server doesn’t have permission to access or use the opt-jpg/opt-png/opt-gif utilities.

    The other possibility is that your host didn’t install littleutil’s dependencies, so opt-jpg, opt-png, or opt-gif weren’t actually installed. For example, if you are missing pngcrush, then installing littleutils won’t install opt-png because opt-png requires pngcrush.

    How would i install this utility thingy for my QNAP ?

    Any ideas o.O; ?

    it’s linux.

    Plugin Author Jacob Allred


    I’m assuming your QNAP is a NAS, in which case, I have no idea how you would install littleutils on it.

    Looks like QNAP runs embedded Linux, which basically means that while it is technically Linux, it is an extremely stripped down version and the bundled packages is going to vary from one device to another. Without having access to the particular model you have, I can’t give accurate advice on what you need to do to get littleutils installed properly.

    Sorry I wasn’t able to be more help.

    So, my host says that everything was installed correctly, including the dependencies etc, and that it’s in the PATH. Not sure what else to do at this point. Any other suggestions?

    Plugin Author Jacob Allred


    My guess is your host hasn’t given the web user access to the littleutils binaries. They probably installed as root and are testing as root, so they don’t see the issue that the web user doesn’t have access to the binaries.

    Other than that, I can’t offer much help without having access to the server. Sorry. 🙁

    @richardmtl I have the exact same problem as you. I installed everything and I’m getting the -Bad Respone error after bulk optimizing and in the library every image shows

    “Unsupported file type”, and beside jpg files I get “Unsupported file type
    opt-jpg is missing”

    no matter the file type.

    Plugin Author Jacob Allred


    I’ve modified the latest version (1.1.6) to make it possible to disable the littleutils check. Looks like my method of detecting if it is installed doesn’t work on some hosts.

    To disable the check, add the following to your wp-config.php:

    define(‘CW_IMAGE_OPTIMIZER_SKIP_CHECK’, true);

    Plugin Author Jacob Allred


    Making people modify their wp-config.php isn’t very user friendly, so I’ve just pushed 1.1.7. This new version has a settings page that makes it easy to disable the littleutils check by simply checking a box.

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘[Plugin: CW Image Optimizer] "Unknown type" and "Bad response"’ is closed to new replies.