julienp
Forum Replies Created
-
Forum: Plugins
In reply to: [TinyPNG - JPEG, PNG & WebP image compression] Problem with woocomerceProductI fix it 🙂
When it was a ‘watermarked file’ like :http://s3bfotovideo.com/test/wp-content/uploads/2015/01/124-150x150_watermarked.jpg
the $file was :’/home/sbfotovihr/www/test/wp-content/uploads/./minimalistic-patterns_00378980-150×150.jpg’
The folder was not present, so in the php I’ve modify the function:
public function compress_file($file) {
if (!file_exists($file)) {
// throw new Tiny_Exception(‘File does not exists’, ‘FileError’);
$file= str_replace(‘/./’, ‘/2015/01/’, $file);
if (!file_exists($file)) {
throw new Tiny_Exception($file, ‘FileError’);
}
}
list($output, $details) = $this->compress(file_get_contents($file));
file_put_contents($file, $output);
return $details;
}The problem is that I have to modify manually the php when the photo folder is different, but now I can compress all of my jpg… 🙂
Forum: Plugins
In reply to: [TinyPNG - JPEG, PNG & WebP image compression] Problem with woocomerceProductYeah that’s what I thought 🙂
I’ll try if it worksThank you !
Forum: Plugins
In reply to: [TinyPNG - JPEG, PNG & WebP image compression] Problem with woocomerceProductThanks for the answer.
Could you please tell me where I can find the php function that find the name of a picture like ‘xxxx_300x300.jpg’ ?I’ll search on the php code to adapt the function for woocomerce 😉