<?xml version="1.0"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Transition Technology: Ticket #348: Thumbnail generating error when files names are UTF-8</title>
    <link>http://localhost:8080/trac/ticket/348</link>
    <description>&lt;p&gt;
Saw this in the dblog report:
&lt;/p&gt;
&lt;pre class="wiki"&gt;User error: ImageMagick reported error code 1. Message: convert: unable to open image `sites/default/files/images/PS_DSC2064 HP Joo do Gro.jpg': gick-6.6.0/modules-Q16/coders/jpeg.la @ error/blob.c/OpenBlob/2489. convert: unable to open image `sites/default/files/images/PS_DSC2064 HP Joo do Gro.jpg': @ error/blob.c/OpenBlob/2489. convert: missing an image filename `sites/default/files/imagecache/thumb-small/images/PS_DSC2064 HP Joo do Gro.jpg' @ error/convert.c/ConvertImageCommand/2940. in _imageapi_imagemagick_convert_exec() (line 235 of /web/transitionnetwork.org/www/sites/all/modules/imageapi/imageapi_imagemagick.module).
&lt;/pre&gt;&lt;p&gt;
See &lt;a class="ext-link" href="https://www.transitionnetwork.org/admin/reports/event/6469093"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://www.transitionnetwork.org/admin/reports/event/6469093&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
The file in question is &lt;tt&gt;/web/transitionnetwork.org/www/sites/default/files/images/PS_DSC2064 HP João do Grão.jpg&lt;/tt&gt; and there appears to be a problem passing the ã to &lt;a class="missing wiki"&gt;ImageMagick?&lt;/a&gt;.
&lt;/p&gt;
</description>
    <language>en-us</language>
    <image>
      <title>Transition Technology</title>
      <url>/trac/chrome/site/TransitionNetwork-Logo-Web-Small.jpg</url>
      <link>http://localhost:8080/trac/ticket/348</link>
    </image>
    <generator>Trac 0.12.5</generator>
    <item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Wed, 28 Sep 2011 13:56:36 GMT</pubDate>
      <title>hours, owner, status, totalhours changed</title>
      <link>http://localhost:8080/trac/ticket/348#comment:1</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/348#comment:1</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.2&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;owner&lt;/strong&gt;
              changed from &lt;em&gt;jim&lt;/em&gt; to &lt;em&gt;chris&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;new&lt;/em&gt; to &lt;em&gt;accepted&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;0.2&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
Another example of this:
&lt;/p&gt;
&lt;pre class="wiki"&gt;User error: ImageMagick reported error code 1. Message: convert: unable to open image `sites/default/files/workspace/logos/Mdaillon IO en transition 290x152.png': gick-6.6.0/modules-Q16/coders/png.la @ error/blob.c/OpenBlob/2489. convert: unable to open image `sites/default/files/workspace/logos/Mdaillon IO en transition 290x152.png': @ error/blob.c/OpenBlob/2489. convert: unable to open file `sites/default/files/workspace/logos/Mdaillon IO en transition 290x152.png' @ error/png.c/ReadPNGImage/2951. convert: missing an image filename `sites/default/files/imagecache/thumb-medium/workspace/logos/Mdaillon IO en transition 290x152.png' @ error/convert.c/ConvertImageCommand/2940. in _imageapi_imagemagick_convert_exec() (line 235 of /web/transitionnetwork.org/www/sites/all/modules/imageapi/imageapi_imagemagick.module).
&lt;/pre&gt;&lt;p&gt;
&lt;a class="ext-link" href="https://www.transitionnetwork.org/admin/reports/event/6472204"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://www.transitionnetwork.org/admin/reports/event/6472204&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
File: &lt;tt&gt;/web/transitionnetwork.org/www/sites/default/files/workspace/logos/Médaillon IO en transition 290x152.png&lt;/tt&gt;
&lt;/p&gt;
&lt;p&gt;
What is needed is for file names to be turned into US ASCII before the thumbnails are generated from them, or perhaps imagemagick can be made to work with UTF8 filenames?
&lt;/p&gt;
&lt;p&gt;
Or perhaps I can fix it at a server level, see &lt;a class="ext-link" href="http://drupal.org/node/352262"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;http://drupal.org/node/352262&lt;/a&gt; I'll test this on the dev server and if it works apply it to the live server.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>jim</dc:creator>

      <pubDate>Wed, 28 Sep 2011 14:11:05 GMT</pubDate>
      <title></title>
      <link>http://localhost:8080/trac/ticket/348#comment:2</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/348#comment:2</guid>
      <description>
        &lt;p&gt;
Or, provided you can install the high quality version (not usually in the repository for Debian without adding another source) we can switch to the GD library?
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>chris</dc:creator>

      <pubDate>Thu, 29 Sep 2011 10:43:21 GMT</pubDate>
      <title>hours, status, totalhours changed; resolution set</title>
      <link>http://localhost:8080/trac/ticket/348#comment:3</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/348#comment:3</guid>
      <description>
          &lt;ul&gt;
            &lt;li&gt;&lt;strong&gt;hours&lt;/strong&gt;
                changed from &lt;em&gt;0.0&lt;/em&gt; to &lt;em&gt;1.5&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;status&lt;/strong&gt;
                changed from &lt;em&gt;accepted&lt;/em&gt; to &lt;em&gt;closed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;resolution&lt;/strong&gt;
                set to &lt;em&gt;fixed&lt;/em&gt;
            &lt;/li&gt;
            &lt;li&gt;&lt;strong&gt;totalhours&lt;/strong&gt;
                changed from &lt;em&gt;0.2&lt;/em&gt; to &lt;em&gt;1.7&lt;/em&gt;
            &lt;/li&gt;
          &lt;/ul&gt;
        &lt;p&gt;
The suggestion of setting LANG in &lt;tt&gt;/etc/init.d/apache2&lt;/tt&gt; didn't work, it was still C, but setting it in &lt;tt&gt;/etc/apache2/envvars&lt;/tt&gt; does work, see &lt;a class="ext-link" href="https://kiwi.transitionnetwork.org/info/"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://kiwi.transitionnetwork.org/info/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
However this didn't fix the problem.
&lt;/p&gt;
&lt;p&gt;
What did was editing &lt;tt&gt;sites/all/modules/imageapi/imageapi_imagemagick.module&lt;/tt&gt; and adding a new line 153:
&lt;/p&gt;
&lt;pre class="wiki"&gt;  setlocale(LC_CTYPE, "en_GB.UTF-8");
&lt;/pre&gt;&lt;p&gt;
I have committed this to the trunk after testing it on the dev server:
&lt;/p&gt;
&lt;p&gt;
&lt;a class="ext-link" href="https://tech.transitionnetwork.org/trac/changeset?old_path=%2Fwww%2Ftrunk%2Fsites%2Fall%2Fmodules%2Fimageapi%2Fimageapi_imagemagick.module&amp;amp;old=213&amp;amp;new_path=%2Fwww%2Ftrunk%2Fsites%2Fall%2Fmodules%2Fimageapi%2Fimageapi_imagemagick.module&amp;amp;new=212"&gt;&lt;span class="icon"&gt;​&lt;/span&gt;https://tech.transitionnetwork.org/trac/changeset?old_path=%2Fwww%2Ftrunk%2Fsites%2Fall%2Fmodules%2Fimageapi%2Fimageapi_imagemagick.module&amp;amp;old=213&amp;amp;new_path=%2Fwww%2Ftrunk%2Fsites%2Fall%2Fmodules%2Fimageapi%2Fimageapi_imagemagick.module&amp;amp;new=212&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Jim - are you OK deploying it to live?
&lt;/p&gt;
&lt;p&gt;
just before:
&lt;/p&gt;
&lt;pre class="wiki"&gt;  $command = escapeshellarg($source) .' '. implode(' ', $args) .' '. escapeshellarg($dest);
&lt;/pre&gt;
      </description>
      <category>Ticket</category>
    </item><item>
      
        <dc:creator>jim</dc:creator>

      <pubDate>Thu, 29 Sep 2011 15:02:57 GMT</pubDate>
      <title></title>
      <link>http://localhost:8080/trac/ticket/348#comment:4</link>
      <guid isPermaLink="false">http://localhost:8080/trac/ticket/348#comment:4</guid>
      <description>
        &lt;p&gt;
Yes no probs... I've got some more updates to do early next week so it'll get done then.
&lt;/p&gt;
      </description>
      <category>Ticket</category>
    </item>
 </channel>
</rss>