Last modified: 2014-03-10 00:26:31 UTC
To support upload of WebP images on Commons (bug 25397) we'll want to do basic JPEG or PNG thumbnail conversion. In the future this can be fancied up to serve WebP thumbs to supporting browsers, but for the near term this would allow uploading WebP source images and having them be usable on the site. Probably can convert with ImageMagick... if not can use other tools easily.
r75087 added file type recognition, not sure if anybody's stuck size fetching or thumbnailing in since...
This would be simplest using ImageMagick, but note that the standard Ubuntu build of IM doesn't seem to include webp support. Nice. May have to deal with dependencies... sigh.
FWIW, it seems to work here just fine with standard Ubuntu build? Setting up imagemagick (8:6.6.9.7-5ubuntu3.2) ... igrigorik@igrigorik:~$ convert -version Version: ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC Features: OpenMP igrigorik@igrigorik:~$ convert bugzilla-logo.png -quality 50 -define webp:lossless=true logo.webp igrigorik@igrigorik:~$ ls -alh logo.webp -rw-r----- 1 igrigorik eng 11K Nov 7 14:53 logo.webp
I have some WebP detection magic.
Change 95872 had a related patch set uploaded by btongminh: (bug 48519) Basic support for WebP https://gerrit.wikimedia.org/r/95872
What is the behavior when the thumbnail is larger than the image file? Does the webp get delivered without conversion to JPEG? Example: # image.webp with resolution 400*300 gets uploaded to Commons # An en-wiki-user embedds the file with [[image.webp|900px]]
(In reply to comment #6) > What is the behavior when the thumbnail is larger than the image file? Does > the > webp get delivered without conversion to JPEG? > > Example: > # image.webp with resolution 400*300 gets uploaded to Commons > # An en-wiki-user embedds the file with [[image.webp|900px]] It should output a jpeg thumbnail that is 400px wide (Never outputting the original file is controlled by the mustRender() method. For webP this is always set to true. Not outputting thumb greater than source width is controlled by isVectorized().)