Extension

Archived
Forum
(read-only)

CE Lossless

ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Causing Effect

     

Adding commands in the $config[‘ce_lossless_commands’] array causes the drivers to stop working

Support (Resolved)

hypatia-industries
hypatia-industries

Hey Aaron,

Sorry, I may just be missing something here, but when I try and add some custom configuration to CE Lossless via the commands array it causes the driver in question to fail.

I’m trying to get my image files smaller, so I wanted to run some tests with different config settings. To get started, I just copy/pasted the whole array from the docs and stripped out any drivers I didn’t have installed. Upon reprocessing the images (after deleting their previous versions), none of the drivers ran any compression. Initial config below:

$config['ce_lossless_commands'= array(

 
'pngcrush' => '-reduce -fix -rem alla -cc -q ',
 
'optipng' => '-quiet -o7 ',
 
'jpegtran' => '-copy none -outfile -optimize -progressive ',
 
'jpegoptim' => '--strip-all -q '
 
); 

So then I removed all of the custom config settings except for one driver. The other drivers ran compression, but the driver that had custom settings in the commands array (again, just the commands copy/pasted from the docs) failed to run and logged either the “...was unable to process the image.” or “No compression occurred with the…” errors.

All drivers work fine if I don’t include the commands array. I’m not sure where to start troubleshooting, any help you can offer would be much appreciated.

EE 2.9.3
CE Image 2.4.5
CE Lossless 1.4

-Earl

hypatia-industries
# 1
hypatia-industries

So for anyone else who comes across this problem, the solution is to add {{path}} and {{temp}} tags to the $config[’ce_lossless_commands’] array. Examples of how this works for each driver can be found in the $commands array in the ce_lossless/libraries/Ce_lossless.php file at/or around line 42.

CE Lossless replaces those tags with system paths when the image is processed, so without them the driver was failing.