Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Wikipedia: Mediawiki

Plus-character in file names prevent thumbnail creation

 

 

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded


g.m.hagedorn at gmail

Apr 17, 2012, 5:36 AM

Post #1 of 3 (548 views)
Permalink
Plus-character in file names prevent thumbnail creation

We cannot get thumbnails rendered for media file names that contain a
plus sign (+). The error we see is: "Error generating thumbnail - The
source file for the specified thumbnail does not exist." (but the
original file is there).

We found a web discussion of the problem, but without an solution. We
are using an Apache’s rewrite to process thumbs upon usage (rather
than at page saving time). Is this the culprit? The WMF/Commons have
solved it, but we cannot find a copy of the Apache rewrite WMF is
using (and the problem may be elsewhere anyways).

Has anyone encountered this problem and solved it?

--
Example Thumbnails that do not render:
* http://species-id.net/openmedia/File:Agrostis%2BMibora_sp_Sturm14.jpg
(fetched from commons)
* http://species-id.net/openmedia/File:Amphibienlaich_%2B_Larven_Plustest.jpg
(manually uploaded)

Technical details:
Our mediwiki $wgIllegalFileChars setting includes ":" and "&", no "+"
We use a debian 6 server with standard php, apache2, mysql and mediawiki 1.18.1.
--

Your help is much appreciated!

Andreas and Gregor

---------------------------------
Dr. G. Hagedorn
+49-(0)30-8304 2220 (work)
+49-(0)30-831 5785 (private)
http://www.linkedin.com/in/gregorhagedorn
https://profiles.google.com/g.m.hagedorn/about

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


Platonides at gmail

Apr 18, 2012, 10:43 AM

Post #2 of 3 (502 views)
Permalink
Re: Plus-character in file names prevent thumbnail creation [In reply to]

On 17/04/12 14:36, Gregor Hagedorn wrote:
> We cannot get thumbnails rendered for media file names that contain a
> plus sign (+). The error we see is: "Error generating thumbnail - The
> source file for the specified thumbnail does not exist." (but the
> original file is there).
>
> We found a web discussion of the problem, but without an solution. We
> are using an Apache’s rewrite to process thumbs upon usage (rather
> than at page saving time). Is this the culprit? The WMF/Commons have
> solved it, but we cannot find a copy of the Apache rewrite WMF is
> using (and the problem may be elsewhere anyways).
>
> Has anyone encountered this problem and solved it?
>
> --
> Example Thumbnails that do not render:
> * http://species-id.net/openmedia/File:Agrostis%2BMibora_sp_Sturm14.jpg
> (fetched from commons)
> * http://species-id.net/openmedia/File:Amphibienlaich_%2B_Larven_Plustest.jpg
> (manually uploaded)

Yes, + in filenames is problmetic.
How are you doing the rewriting to thumb.php?


_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l


g.m.hagedorn at gmail

Apr 21, 2012, 7:55 AM

Post #3 of 3 (477 views)
Permalink
Re: Plus-character in file names prevent thumbnail creation [In reply to]

The following is our apache config for the site:

Alias /wiki /var/www/v-species/w/index.php
Alias /openmedia /var/www/v-species/o/index.php
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteLogLevel 0
# permanent redirect "www.xxx.net/wiki/" to "xxx.net/wiki/" ALL OLD URLs
RewriteCond %{HTTP_HOST} !^species-id\.net [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/?(.*) http://species-id.net/$1 [L,R=301,NE]
# redirect wrong uppercase:
RewriteRule ^(.*)(/WIKI/)(.*)$ $1/wiki/$3 [R]


# Thumb generation (see Manual:Thumb.php)
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^/w/media/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$
/w/thumb.php?f=$1&width=$2 [L,QSA]

RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
RewriteRule ^/o/media/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$
/o/thumb.php?f=$1&width=$2 [L,QSA]


I very much appreciate it if you can see what needs to be changed so
that "&" and "+" are working. We have analyzed it and searched for
people having similar problems. Both work fine for uploading and full
size image, but thumb generation fails. We use a standard imagemagick
thumb generator, nothing special as far as I know. Thumb generation
from command line works fine, which is why we suspect the apache
rewrites to be involved.

Gregor

_______________________________________________
MediaWiki-l mailing list
MediaWiki-l [at] lists
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Wikipedia mediawiki RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.