Version: 1.1, by EXIDE
Developer Last Online: Apr 2016
Category: Miscellaneous Hacks -
Version: 4.1.11
Rating:
Released: 12-14-2011
Last Update: 05-11-2012
Installs: 29
DB Changes Uses Plugins
Is in Beta Stage
No support by the author.
This sends your image attachments and avatars to smush.it for compression, if the image can be compressed it will download the newly compressed one and replace the attachment or avatar with it.
If you would like features added to it or you find any bugs or problems please let me know.
How do I know if it is working and/or what percentage the image got compressed.
I have a similar plugin in Wordpress and love it.
A future addition would be the ability to re-smush attachments already in the forum. Attachments that got uploaded prior to this plugin.
At the moment you can check the image size by admincp or checking the attachment file directly, I'm also planning to add some stats data to the attachments displaybits.
Currently working on giving people the option to re-smush attachments at the moment, I expect to update this mod in the next 2-3 days.
Quote:
Originally Posted by Disasterpiece
This messes up my error_reporting setting... Could you change it to this?
PHP Code:
$err_old = error_reporting(0);
if (file_exists($sattachment['attachment_folder_id']))
{
...
}
error_reporting($err_old);
Did this by myself but maybe you might want to include this in the next update, since it's more generic and respects the administrator's own settings.
I don't plan too make this modifcation compatible with other mods at the moment, but your free to make that change for yourself. Although the next version will not require to disable error_reporting.
Also if you want to get the current error_reporting level for the script just remove the "0" from the function. As your way disables error_reporting for the rest of the script.
It would be nice if it could smush all incoming avatars as well
I like this opinion. But it would have to have the option to turn that feature on or off. Some communities allow or have people who use animated GIF files and sadly, Yahoo's Smush It can and sometimes does remove that animation in its optimization process.
edit: Would it be possible for this to have the option to skip over GIF files?
I like this opinion. But it would have to have the option to turn that feature on or off. Some communities allow or have people who use animated GIF files and sadly, Yahoo's Smush It can and sometimes does remove that animation in its optimization process.
edit: Would it be possible for this to have the option to skip over GIF files?
Both features added, 3.8.x version updated aswell, next update will include the ability to smush already uploaded avatars and attachments.
It looks like the script does not use the table prefix. My tables are vb_* I get the error:
ALTER TABLE `filedata` ADD `smushed` VARCHAR( 3 ) NOT NULL DEFAULT 'no';
Any chance you could update this to use the table prefix? I can do it myself but I would imagine others are going to run into this same issue and it seems like it would reduce a lot of posts from people saying, "It won't install" :-)
It looks like the script does not use the table prefix. My tables are vb_* I get the error:
ALTER TABLE `filedata` ADD `smushed` VARCHAR( 3 ) NOT NULL DEFAULT 'no';
Any chance you could update this to use the table prefix? I can do it myself but I would imagine others are going to run into this same issue and it seems like it would reduce a lot of posts from people saying, "It won't install" :-)
Thanks for pointing that out, completely looked over those sections.
Theres also a typo in the uninstall code, you will need to change the first line from:
PHP Code:
$db->query_read("ALTER TABLE " . TABLE_PREFIX . "filedata DROP smushed;")
To this:
PHP Code:
$db->query_read("ALTER TABLE " . TABLE_PREFIX . "filedata DROP smushed");
Everyone else can do those edits manually or upload version 1.1 and allow it to overwrite.
Invalid SQL:
ALTER TABLE vb4_`filedata` ADD `smushed` VARCHAR( 3 ) NOT NULL DEFAULT 'no';
MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`filedata` ADD `smushed` VARCHAR( 3 ) NOT NULL DEFAULT 'no'' at line 1
Error Number : 1064
Request Date : Friday, May 11th 2012 @ 07:59:27 AM
Error Date : Friday, May 11th 2012 @ 07:59:30 AM
Script : http://www.xxxx.com/forum/admincp/ad...=productimport
Referrer : http://www.xxxx.com/forum/admincp/pl...?do=productadd
IP Address : 99.72.92.220
Username : admin
Classname : vB_Database_MySQLi
MySQL Version : 5.1.62-cll
Is there anyway to smush attachments that are already in the file system? One at a time is fine from the attachment menu in the control panel would be fine.
Is there anyway to smush attachments that are already in the file system? One at a time is fine from the attachment menu in the control panel would be fine.
Currently no you can't, but I will start again on this mod tomorrow and give you the following options to smush existing images.
New page in admin panel listing non-smushed images.