You are here: Foswiki>Tasks Web>Item9207 (15 Mar 2011, GeorgeClark)Edit Attach

Item9207: not including image size for some JPEG files

Priority: Normal
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component: TopicAttachment
Reported By: TimotheLitt
Waiting For:
Last Change By: GeorgeClark
When creating a link for a new attachment, parses image files to determine the image size for the ≶IMG> tag.

The magic code for JPEG files doesn't handle jpeg DCF - the format used by digital camera media cards. So many, many of today's attached JPEG files don't get the intended height and width in the tag!

This goes back to, and still exists in, TWiki

Easy fix:

sub _imgsize {
            elsif ($a == 0xFF
                && $b == 0xD8
                && $c == 0xFF
                && $d == 0xE0 )

                #  JPG ff d8 ff e0
            elsif ($a == 0xFF
                && $b == 0xD8
                && $c == 0xFF
                && ($d == 0xE0 || $d == 0xE1) )

                #  JPG ff d8 ff e0/e1=

-- TimotheLitt - 27 Jun 2010

Thanks for the fix. Checked into trunk

-- KennethLavrsen - 27 Jun 2010

ItemTemplate edit

Summary not including image size for some JPEG files
ReportedBy TimotheLitt
Codebase trunk
SVN Range
AppliesTo Engine
Component TopicAttachment
Priority Normal
CurrentState Closed
Checkins distro:f1130a15f038
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r5 - 15 Mar 2011, GeorgeClark - This page was cached on 14 Jan 2020 - 14:43.

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