Last modified: 2011-07-04 21:27:26 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T28755, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 26755 - Option to Smush.it on image upload
Option to Smush.it on image upload
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
Extensions requests (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-16 13:13 UTC by Subfader
Modified: 2011-07-04 21:27 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Subfader 2011-01-16 13:13:11 UTC
Yahoo!'s Smush.it feature is a lossless image optimization. If you dunno it, read here http://developer.yahoo.com/yslow/smushit/
The API is
* optimizing JPEG compression
* converting certain GIFs to indexed PNGs
* stripping the un-used colours from indexed images
* meta data is NOT stripped from JPEGs

Adding this has been discussed on WP with the main anti-argument that thumbs are not smushed and storage doesn't matter for WikiMedia. But that's not the point.
The point is to save 2-20% storage on original images. Not every wiki is Wikipedia and for some storage does matter. Same for the traffic on the wiki and from hotlinking images.

My request is to include the Smush.it API on Special:Upload. 
The feature could be optional by adding a checkbox called "Smush.it".

A plugin for WordPress exists to give you an idea: http://wordpress.org/extend/plugins/wp-smushit/

I don't see any disadvantage, except that the upload process may take a 2-3 seconds longer.
Comment 1 Derk-Jan Hartman 2011-01-16 13:43:52 UTC
No reason to use smush-it. just find the proper imagemagick commands and apply  them, or create new imagemagick commands that do the same.

We don't want to have to depend on yahoo.com for something like this.
Comment 2 Subfader 2011-01-16 15:36:02 UTC
Fair enough. Will google for those imagemagick commands.
Comment 3 Sam Reed (reedy) 2011-01-17 05:28:50 UTC
Not sure if you could make this into an extension (for those who did want to use it...)
Comment 4 Brion Vibber 2011-01-18 19:34:04 UTC
MediaWiki generally prefers to accept input files in their exact original format, then create derivative files optimized for output (convert to web-friendly sizes & formats, strip giant EXIF thumbnails, etc).

To actually modify the original file on upload, you'd probably want to do it pretty early in the upload process, so you're not worrying about for instance accidentally changing the file after a SHA-1 checksum has been generated.

The 'UploadVerifyFile' hook might actually be an ok place to rig something up, though it might not be ideal. (Disclaimer: I haven't tried it.)
Comment 5 Bryan Tong Minh 2011-01-18 19:35:48 UTC
(In reply to comment #4)
> The 'UploadVerifyFile' hook might actually be an ok place to rig something up,
> though it might not be ideal. (Disclaimer: I haven't tried it.)

It needs a new hook I think. Something that is called just after fetchFile().
Comment 6 Mark A. Hershberger 2011-01-22 06:28:46 UTC
Assigning to subfader@gmail.com so he can respond with whatever his findings are.
Comment 7 Subfader 2011-01-22 11:33:46 UTC
Not much I found out. Except strip there are no other imagemagick options you can easily use on the fly without checking the image with a script.

The main advantage of the smush.it API is, that you don't to care about all that (nor in the future). The image you receive is losslessly optimized to the max while keeping metadata for JPEGs.

Thumbs generated by with imagemagick don't save much filesize when you smush them. Except PNG thumbs of course, but that's the compromize for having it resized on the fly.

But I talk about saving webspace and traffic for the originally uploaded images. Thus I can understand Brion's pov having the originals untouched. But not every wiki using MediaWiki is Wikipedia... (I love that argument).

So, I'd love to have an option to smuch images on upload, but can understand if no dev wants to implent it since most devs only code what is good for WP.
Comment 8 p858snake 2011-01-22 13:43:57 UTC
This would probably be much better as a extension that hooked into MW, re product-ing and component-ing as such.
Comment 9 Subfader 2011-07-03 16:02:10 UTC
I gave up using Smush.it cos it's not worth the effort the manual way.

Also I came across a few bad results (like 1 in 100) where color layers (dunno what they're called) were removed in PNGs.

Also I agree it may be better as extension.

Someone feel free to close this as WONTFIX.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links