• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

As filed in TWiki:Plugins.ImagePlugin, using this plugin with i.e. TWiki:Codev.SpeedyCGI disables I18N-settings after first use.

This means that a WikiWord like VenstreTå which links automatically before first %IMAGE% tag is encountered, no longer works afterwards (it becomes VenstreTå).

This could be caused by Image::Magick itself, perhaps there is some way to isolate that module better if this is the case?

-- SP

I've set up a test page with speedy and without speedy... and you are right.

It seems as though a use Image::Magick will reset locale usage. So I copied the relevant part from TWiki.pm right after that into ImagePlugin::Core ...

BEGIN {
    if ( $TWiki::cfg{UseLocale} ) {
        $ENV{LC_CTYPE} = $TWiki::cfg{Site}{Locale};
        require POSIX;
        import POSIX qw( locale_h LC_CTYPE );
        setlocale(&LC_CTYPE, $TWiki::cfg{Site}{Locale});
    }
};

... and it works again frown

-- MD

Thanks, that works nicely - I agree the fix is not that beautiful though :-). Will you consider to add it to the plugin?

I see some postings like http://www.imagemagick.org/pipermail/magick-users/2002-June/003036.html (2002) which also wonders about this. Perhaps it is really nescessary for them to do this to have text written to pictures correctly .. shrug. Would be a courtesy if they would set the locale back correctly after the job was done, though.

I have asked politely regarding this in their mailing lists: bugs, developers.

-- SP

Yes, I will add it to the plugin in this form. There are lots of people out there that want to use i18n and will not upgrade imagemagick any soon.

And btw. ImageGalleryPlugin will suffer from the same error to. So the workaround will go in there too.

-- MD

You should be able to make a cleaner fix to ImagePlugin - see TWiki:Codev.InternationalisationGuidelines for details on how to make TWiki plugins and core modules work with I18N (both WikiWord and user interface I18N).

I have just updated that page with TWiki 4.x code examples and improved its structure.

The fix suggested above is not enough in general for plugins to work with I18N, it is just fixing the immediate problem.

-- RD

ItemTemplate
Summary Using ImagePlugin in an accelerated context disables I18N settings
ReportedBy TWiki:Main.SteffenPoulsen
Codebase

SVN Range TWiki-4.1, Mon, 30 Oct 2006, build 11853
AppliesTo Extension
Component ImagePlugin, ImageGalleryPlugin
Priority Urgent
CurrentState Closed
WaitingFor

Checkins 12310
TargetRelease n/a
Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatpatch i18n_ImagePlugin.patch r1 manage 0.8 K 2006-11-04 - 12:40 SteffenPoulsen Patch for re-setting correct locale after use Image::Magick;
Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2006-12-18 - MichaelDaum
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback