ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Exif Demo it giving Error '' is not a valid...
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

yogiyang

India
727 Posts

Posted - Jun 20 2020 :  00:49:40  Show Profile  Reply
Hello,

I am testing how EXIF data is written in an image and how it is recognized by other image processing software.

I compiled the demo EXIF (Demos\InputOutput\Exif). I selected a file which is saved by ImageEn to JPEG format.

In the demo kept the default settings as they are.

I made some changes to EXIF properties XP Title, XP Comment and XP Author.

When I click the Save Changes button I get following error:
---------------------------
Exif Demo
---------------------------
'' is not a valid floating point value.
---------------------------
OK
---------------------------

After this error nothing gets written in the Exif data of the image.

The fine in question is attached at the end of this post.

EXIF is a new beast for me so what must be the problem and how to handle it.

TIA




Yogi Yang

xequte

38613 Posts

Posted - Jun 20 2020 :  04:01:18  Show Profile  Reply
Hi Yogi

Replace the WriteParameters_Method1 method with:

// Only partially implemented...
procedure TMainForm.WriteParameters_Method1();
begin
  with ImageEnView1.IO.Params do
  begin
    // Set flag that file contains EXIF information
    EXIF_HasEXIFData           := True;

    EXIF_ImageDescription      := AnsiString( StringGrid1.Cells[1, 1] );
    EXIF_Make                  := AnsiString( StringGrid1.Cells[1, 2] );
    EXIF_Model                 := AnsiString( StringGrid1.Cells[1, 3] );
    EXIF_Orientation           := StrToIntDef(StringGrid1.Cells[1, 4], 0);
    EXIF_XResolution           := StrToIntDef(StringGrid1.Cells[1, 5], 0);
    EXIF_YResolution           := StrToIntDef(StringGrid1.Cells[1, 6], 0);
    EXIF_Software              := AnsiString( StringGrid1.Cells[1, 7] );
    EXIF_DateTime              := AnsiString( StringGrid1.Cells[1, 8] );
    EXIF_Copyright             := AnsiString( StringGrid1.Cells[1, 9] );
    // EXIF_ExposureTime          := StringGrid1.Cells[1, 10];
    EXIF_FNumber               := StrToFloatDef(StringGrid1.Cells[1, 11], -1);
    EXIF_ExposureProgram       := StrToIntDef(StringGrid1.Cells[1, 12], -1);
    EXIF_ExifVersion           := AnsiString( StringGrid1.Cells[1, 13] );
    EXIF_DateTimeOriginal      := AnsiString( StringGrid1.Cells[1, 14] );
    EXIF_DateTimeDigitized     := AnsiString( StringGrid1.Cells[1, 15] );
    // EXIF_CompressedBitsPerPixel    := StringGrid1.Cells[1, 16];
    // EXIF_ShutterSpeedValue         := StringGrid1.Cells[1, 17];
    // EXIF_ApertureValue             := StringGrid1.Cells[1, 18];
    // EXIF_BrightnessValue           := StringGrid1.Cells[1, 19];
    // EXIF_ExposureBiasValue         := StringGrid1.Cells[1, 20];
    // EXIF_MaxApertureValue          := StringGrid1.Cells[1, 21];
    // EXIF_SubjectDistance           := StringGrid1.Cells[1, 22];
    // EXIF_MeteringMode              := StringGrid1.Cells[1, 23];
    // EXIF_LightSource               := StringGrid1.Cells[1, 24];
    // EXIF_Flash                     := StringGrid1.Cells[1, 25];
    // EXIF_FocalLength               := StringGrid1.Cells[1, 26];
    // EXIF_SubsecTime                := StringGrid1.Cells[1, 27];
    // EXIF_SubsecTimeOriginal        := StringGrid1.Cells[1, 28];
    // EXIF_SubsecTimeDigitized       := StringGrid1.Cells[1, 29];
    // EXIF_FlashPixVersion           := StringGrid1.Cells[1, 30];
    // EXIF_ColorSpace                := StringGrid1.Cells[1, 31];
    EXIF_ExifImageWidth        := StrToIntDef(StringGrid1.Cells[1, 32], 0);
    EXIF_ExifImageHeight       := StrToIntDef(StringGrid1.Cells[1, 33], 0);
    EXIF_RelatedSoundFile      := AnsiString( StringGrid1.Cells[1, 34] );
    // EXIF_FocalPlaneXResolution     := StringGrid1.Cells[1, 35];
    // EXIF_FocalPlaneYResolution     := StringGrid1.Cells[1, 36];
    // EXIF_FocalPlaneResolutionUnit  := StringGrid1.Cells[1, 37];
    // EXIF_ExposureIndex             := StringGrid1.Cells[1, 38];
    // EXIF_SensingMethod             := StringGrid1.Cells[1, 39];
    // EXIF_FileSource                := StringGrid1.Cells[1, 40];
    // EXIF_SceneType                 := StringGrid1.Cells[1, 41];
    EXIF_CameraOwnerName       := AnsiString( StringGrid1.Cells[1, 43] );
    EXIF_BodySerialNumber      := AnsiString( StringGrid1.Cells[1, 44] );
    EXIF_LensMake              := AnsiString( StringGrid1.Cells[1, 45] );
    EXIF_LensModel             := AnsiString( StringGrid1.Cells[1, 46] );
    EXIF_LensSerialNumber      := AnsiString( StringGrid1.Cells[1, 47] );
    // EXIF_Gamma              := StringGrid1.Cells[1, 48];
    // EXIF_SubjectArea        := StringGrid1.Cells[0, 49];
    EXIF_SubjectLocationX      := StrToIntDef( StringGrid1.Cells[1, 50], -1 );
    EXIF_SubjectLocationY      := StrToIntDef( StringGrid1.Cells[1, 51], -1 );

    EXIF_XPTitle               := WideString( StringGrid1.Cells[1, 52] );
    EXIF_XPComment             := WideString( StringGrid1.Cells[1, 53] );
    EXIF_XPAuthor              := WideString( StringGrid1.Cells[1, 54] );
    EXIF_XPKeywords            := WideString( StringGrid1.Cells[1, 55] );
    EXIF_XPSubject             := WideString( StringGrid1.Cells[1, 56] );
  end;
end;


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

yogiyang

India
727 Posts

Posted - Jun 21 2020 :  03:49:53  Show Profile  Reply
Hello Nigel,

Thanks for the updated code.

Now it is working and I have also manage to solve my problem.

TIA


Yogi Yang
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: