New release of my image metadata reading/writing code (CCR Exif v1.5.1)

Rather belatedly, given the code has been sitting in the SVN trunk for many months, I’ve finalised a new ‘stable’ release of my image metadata reading/writing library, CCR Exif (despite its name, it has some support for IPTC and XMP metadata too). If people using it have been updating from the Google Code repository, the only real change is the removal of the word ‘beta’ from the file headers, however I did put through an important bug fix concerning XMP writing not so long ago. I’ve also put up a new ZIP file for people who prefer that, however I would recommend using the SVN repository instead (I only commit bug fixes and structural changes I’m sure I won’t reverse).

Going forward, I won’t be supporting the Delphi 2006 compiler any more, and possibly later ones too – we’ll see. This 1.5.1 version will still be available for old compilers however.

[Update: soon after I posted it, someone spotted a few incompatibilities between v1.5.1 and D2006. Because of that, there will be a v1.5.2 that supports D2006. Use the trunk version if you want D2006 support now, though really, it may be time to think about upgrading…]

Advertisements

23 thoughts on “New release of my image metadata reading/writing code (CCR Exif v1.5.1)

    • Because of past experience, I’m waiting a couple of days in case someone spots an issue, then I’ll do a tag, but yes, you can just take the trunk.

    • The tag’s been created now. I’ve also made the changes you suggested for TCustomExifData.SetAuthor in the trunk.

  1. Hi Cris,

    thank you very much for the 1.5.1 !
    Two years ago I asked you for help with CCR.Exif.
    Now I have a problem again:

    Some pictures (but only some, not all) from the Nikon Coolpix S6200 seam to lose their Exifs.

    I do this:
    – open a pic
    – process the bitmap
    – assign the bitmap with [jaPreserveMetadata]
    – create a new thumb
    – save the pic

    When I open the saved pic I can not read the exif-Data.
    It is with 1.1.1 just as with Exif 1.5.1

    A sample you can find here:
    http://www.bertram-hafner.de/tmpBilder/Coolpix 6200 Sample.zip

    Thank you for help
    Bertram

    • Hi Bertram

      I’m unclear what I’m supposed to be looking at. When I run the first image through the Resaving Test demo, it comes out fine. The second image (the pink-ish one) also reads fine, though with a lot less tags. Could you write a simple program that demonstrates your problem please? I would prefer a console project, though a simple VCL one would be OK if you would be happier doing that.

        • Thanks for the test project. Having run it, I can say that the problem (bug) concerns changing the thumbnail – try commenting out ‘Thumbnail := NewThumb;’ and rerunning your test project to see what I mean. I’ll see what I can do.

          • Hi Chris,

            may I ask, wether you could find out something?

            I have another, similar problem relating to some pictures from Eos 40D, for example:

            I use the same test project as above.
            1. Load picture
            2. Process picture
            3. Save picture as “IMG_7343_b.JPG”
            4. Load picture “IMG_7343_b.JPG”
            5. Process picture
            6. At trying to save it again, I become “XMP is not valid”.

            Regards
            Bertram

          • Thanks for the new test case. I haven’t forgotten about the first one, I’ve just been busy with other things, sorry…

  2. Hi Chris,

    now a user reports an other problem: jpg’s from DxO-RAW-converter lose their EXIFs by saving with CCR.Exif

    Regards Bertram

    • Bertram –

      Keep in mind anything I do with this code is in my spare time, and for free. If you can help to debug the problem, that would be great.

        • I found: It seems not to be a specific problem of CCR.Exif.TJpegImageEx, but CCR.Exif perhaps could solve it.

          First:
          With this code Exifs in are corrupted:
          JpegImage.LoadFromFile();
          Bitmap.Assign(JpegImage);
          JpegImage.SaveToFile();

          But:
          ExifTool can heal the problem:
          When I increment the DateTime of the DxO-File with 1 second (before running this code), then has correct Exifs.
          I think the cause of the problem are three apparently invalid entries in meta data block “Image Processing” at index $636, $1103 and $1104. These
          entries are removed when changing the date with ExifTool and the resulting file can be subsequently processed by CCR.Exif without any problems.

          Second:
          Chris, long ago, after a question of me you wrote specially the procedure
          “TJPEGImageEx.Assign(Source: TBitmap; Options: TAssignOptions)” in CCR.Exif.
          After using this procedure with the DxO-File, Exifs are lost (or corrupt?).
          I’m not versed so well in streams and buffers, so I can’t say it more specific.

          I analysed it with these two DxO-Files, an original one and a repaired (with ExifTool) one:

          Thank you very much for studiing this problem. But it doesn’t hurry at all.
          Bertram

      • I found: It seems not to be a specific problem of CCR.Exif.TJpegImageEx, but CCR.Exif perhaps could solve it.

        First:
        With this code Exifs in are corrupted:
        JpegImage.LoadFromFile();
        Bitmap.Assign(JpegImage);
        JpegImage.SaveToFile();

        But:
        ExifTool can heal the problem:
        When I increment the DateTime of the DxO-File with 1 second (before running this code), then has correct Exifs.
        I think the cause of the problem are three apparently invalid entries in meta data block “Image Processing” at index $636, $1103 and $1104. These
        entries are removed when changing the date with ExifTool and the resulting file can be subsequently processed by CCR.Exif without any problems.

        Second:
        Chris, long ago, after a question of me you wrote specially the procedure
        “TJPEGImageEx.Assign(Source: TBitmap; Options: TAssignOptions)” in CCR.Exif.
        After using this procedure with the DxO-File, Exifs are lost (or corrupt?).
        I’m not versed so well in streams and buffers, so I can’t say it more specific.

        I analysed it with these two DxO-Files, an original one and a repaired (with ExifTool) one:

        Thank you very much for studiing this problem. But it doesn’t hurry at all.
        Bertram

  3. Hi.
    Using Nikon D3200. Trying to get the ShutterSpeed from .jpg file. Works with other EXIF libraries, but not CCRExif (tried v1.1.2 and v1.5.1) .

    Please can you assist, perhaps I’m not using it correctly.

    Regards,

    Eben.

    • Post a sample image somewhere. I’m still pretty busy at the moment, so I can’t promise anything, but I’ll have a look eventually.

  4. Hi Chris,
    I have a problem with “XMP-packet is not valid” in a jpg-file after processing and saving the jpg. Please, see this test-Project:
    http://www.bertram-hafner.de/tmpBilder/XMP_Problem/TestProject_XMPUpdate.zip

    This zip-file includes also “original.jpg”.
    With this test-project I do the following steps:
    1. JpegImageEx.LoadFromfile: “original.jpg”
    2. process the picture
    // I need a new JpegImageEx in save-thread of my Application
    3. JpegImageExNew.Assign(JpegImageEx);
    JpegImageExNew.Assign(Bitmap, [jaPreserveMetadata]);
    // update Exifs
    4. with JpegImageExNew.ExifData do begin
    ExifImageWidth := Bitmap.Width;
    ExifImageHeight := Bitmap.Height;
    end;
    5. JpegImageExNew.SaveToFile: “test.jpg”

    After this, when I open “test.jpg” with your XMPBrowserXE I get “XMP packet is not valid”.
    Thank you for your assistance
    Bertram

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s