You are here: Foswiki>Tasks Web>Item2479 (09 Jan 2012, MichaelDaum)Edit Attach

Item2479: size in ImagePlugin not handeled properly as geometry info

pencil
Priority: Urgent
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: ImagePlugin
Branches: trunk
Reported By: AndreLichtsteiner
Waiting For:
Last Change By: MichaelDaum
When an image is defined with geometry information like "x180" (for geometry syntax see http://www.imagemagick.org/script/command-line-processing.php#geometry) following error show up in our error log files:

stderr: Argument "x180" isn't numeric in numeric gt (>) at /lib/Foswiki/Plugins/ImagePlugin/Core.pm line 465.

-- AndreLichtsteiner - 08 Dec 2009

It seem that the newest ImagePlugin fails on some more simpler tasks already:

%IMAGE{"ake_9l.jpg" size="240" title="Demo" caption="Demo"}%

Should give an image of max 240px width.

ake 9l.jpg
Demo

This works with the plugin version 2.00 (24 Apr 2009), as it is installed on this intallation (ImagePlugin). But it failed with the newest Plugin 2.20 (2009-11-17).

We had to revert to version 2.0.

-- AndreLichtsteiner - 09 Dec 2009

Here's a patch. Please try.

-- MichaelDaum - 09 Dec 2009

Patch looks fine.

Do I understand right, that the new introduced parameter zoom is causing the problem? And, that the patch disables zoom whenever the parameter size contains a non digit in it? Limiting somehow size to width, as all geometry information differing from simply width contain non digits?

But I wonder why zoom was introduced, as it looks to me, size could do the trick already. At least when ImageMagick is used as renderer.

  • size="widthxheight" zoom is on
  • size="widthxheight>" zoom is off

-- AndreLichtsteiner - 10 Dec 2009

Imagine you automatically generate a lot of thumbnails for images found by some wiki app. A zoom=off will avoid pixelized images which already have a smaller geometry than the one %IMAGE specifies, e.g. icons and the like. ImageMagick would happily zoom in ... which is not what you want computing thumbnails most of the time.

Got the idea from some wordpress thumbnailer.

-- MichaelDaum - 10 Dec 2009

Yes, I understand, but the thumbnailer may make use of the ImageMagic Syntax too. I'm just arguing, that the zoom option is redundant to >.

-- AndreLichtsteiner - 14 Dec 2009

Oh I wasn't aware of that syntax.

-- MichaelDaum - 14 Dec 2009

zoom, width and height are all convenience params where you could have crafted an image::magick geometry string via the size parameter. They are only there to remove a bit of geekiness from this image::magick syntax.

Internally, ImagePlugin maps these onto a proper geometry string.

-- MichaelDaum - 09 Jan 2012

ItemTemplate edit

Summary size in ImagePlugin not handeled properly as geometry info
ReportedBy AndreLichtsteiner
Codebase
SVN Range
AppliesTo Extension
Component ImagePlugin
Priority Urgent
CurrentState Closed
WaitingFor
Checkins ImagePlugin:ab95367b9707
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches trunk
trunkCheckins ImagePlugin:ab95367b9707
Release01x01Checkins
I Attachment Action Size Date Who Comment
ImagePlugin.patchpatch ImagePlugin.patch manage 1009 bytes 09 Dec 2009 - 16:50 MichaelDaum  
ake_9l.jpgjpg ake_9l.jpg manage 45 K 09 Dec 2009 - 13:14 AndreLichtsteiner File to demo bug
Topic revision: r9 - 09 Jan 2012, MichaelDaum
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy