• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

Post reply

Other options

Shortcuts: ALT+S save/post or ALT+P preview

Topic summary

Posted by Galfar
 - 15 June 2010, 15:09:32
Thanks for reporting this, I'll fix it right away. 
New features in the trunk haven't been tested that much yet.
Posted by Bernd
 - 15 June 2010, 14:49:22
Version: current trunk from svn
Compiler: FPC 2.5.1/Lazarus
Operating system: Windows 7 (x64)

JPEG throws exception when loading thru

aJPEG: TImagingGraphic;
...
aJPEG := TImagingGraphic.Create;
aJPEG.LoadFromFile('TMP68830.jpg');
aJPEG.Free;

The exception is thrown in "imaging.pas" (TMetadata.TranslateUnits) in line 3934, because the image does not contain any x or y resolution. In this case the call

    XRes := UnitSize / XRes;
    YRes := UnitSize / YRes;     

causes an "div zero" exception. I recommend to check the content of "Xres" and "Yres" and if zero, set it to a default value (72 or 96dpi).

This is a working solution for the problem:

    if XRes <=0 then Xres := 96;
    if YRes <=0 then Yres := 96;
    XRes := UnitSize / XRes;
    YRes := UnitSize / YRes;

Regards
Bernd

SMF spam blocked by CleanTalk