Follow-up: GEDCOM 7 export — photo rotation not exported, non-standard FORM values

Collapse
X
Collapse
 
  • Time
  • Show
Clear All
new posts
  • reggoboy
    Member
    • Jan 2008
    • 109

    #1

    Follow-up: GEDCOM 7 export — photo rotation not exported, non-standard FORM values

    Hi again,

    Two more GEDCOM 7 export issues from Reunion 14.0, following up on my earlier report about CROP coordinates and media records.

    3. Rotation set in Reunion isn't exported

    If a photo is rotated inside Reunion, Reunion shows it upright, but the export gives no indication of the rotation. The image file is exported unchanged (still sideways), and the CROP and _SIZE are in the file's unrotated coordinates. Any other program shows the photo sideways.

    Example: ellie_kit.jpg. The file itself is 360 x 270 with the subject lying sideways and no EXIF orientation tag. Reunion displays it upright. The export says:
    Code:
    2 _SIZE 360.000000 270.000000
    2 CROP
    3 TOP 73
    3 LEFT 9
    3 HEIGHT 173
    3 WIDTH 191
    GEDCOM 7 has no rotation tag, so the only way to carry this over is for the export to write a rotated copy of the image and give _SIZE and CROP in that rotated orientation. Exporting to a .gdz, where Reunion is already copying the files, seems like a natural place to do that.

    4. FORM values aren't standard media types

    GEDCOM 7 says FORM must be a registered media type. Reunion writes image/jpg (should be image/jpeg), image/tif (should be image/tiff), and image/img for a HEIC file (should be image/heic). TNG, where I'm importing to at the moment, happened to ignore these, but stricter importers may not.

    Thanks again,

    Dave
    Dave Kitabjian
  • DrJJWMac
    Member
    • Dec 2015
    • 71

    #2
    WRT 3), how does an app such as iPhotos handle this situation? Does it rotate the raw image before export, or does it export the raw image with an EXIF rotation tag?

    Otherwise, I'd rather demand that a user must rotate an image at the OS level and/or with dedicated photo-editing tools than to have Reunion rotate an image before exporting. Potential security/safety failures are one concern. Potentially overburdening Reunion with additional toolsets for image editing is another.

    WRT 4), it seems Reunion is using the three-letter file extension rather than the EXIF standard (four-letter) tag. Yes, certainly this mistake is one to fix.

    Comment

    • reggoboy
      Member
      • Jan 2008
      • 109

      #3
      Originally posted by DrJJWMac View Post
      WRT 3), how does an app such as iPhotos handle this situation? Does it rotate the raw image before export, or does it export the raw image with an EXIF rotation tag?

      Otherwise, I'd rather demand that a user must rotate an image at the OS level and/or with dedicated photo-editing tools than to have Reunion rotate an image before exporting. Potential security/safety failures are one concern. Potentially overburdening Reunion with additional toolsets for image editing is another.
      Thanks for the reply.

      I don’t know how Photos handles this nor do I have a strong opinion about how Reunion should handle it. But Reunion definitely has a bug to fix here because the currently exported data is not consistent. As I mentioned above, the CROP and SIZE data are rotation-sensitive. So to support that data, and since GEDCOM has no rotation tag, Reunion has no choice but to rotate the media on export. The alternative is data corruption, which is what I’m experiencing.

      Thankfully Claude is cleaning up after Reunion and fixing this and other issues. And I’m trying to give back to the community by reporting the hours of research and fixes I’ve put into this so other Reunion users don’t have to go through the pain I’m going through. Whether anyone acts on it or not is not something I have any control over.
      Last edited by reggoboy; 26 November 2026, 09:30 PM.
      Dave Kitabjian

      Comment

      • reggoboy
        Member
        • Jan 2008
        • 109

        #4
        There is one other alternative which is Reunion at least reporting to the users what media need rotating to not end up with a corrupt import. But currently Reunion is silently leaving users with a mess.
        Dave Kitabjian

        Comment

        • DrJJWMac
          Member
          • Dec 2015
          • 71

          #5
          Apologies. I understand now. Yes, tags on an exported image should be relative to the (x,y) coordinates of a non-rotated format of the exported image.

          Comment

          • reggoboy
            Member
            • Jan 2008
            • 109

            #6
            Thanks again for the reply. You're closer, but not quite right. And I realize that my post left out some clarification that there are two different problem cases involving rotation, each with its own challenges and solutions, and my omission led to some of the confusion.

            I spent a couple more hours digging into this and here's the roundup. Hope this helps.
            image.png
            Dave Kitabjian

            Comment

            • DrJJWMac
              Member
              • Dec 2015
              • 71

              #7
              The details are appreciated.

              In Case A, you recommend that Reunion should alter EXIF data for images that it exports. But the problem seems to be with applications that import images via a GEDCOM import filter and do not ignore the EXIF metadata during the GEDCOM import of images. It therefore appears to be the fault of such applications, not the fault of Reunion, that has to be fixed.

              In Case B, you essentially recommend that Reunion apply an image editing step prior to export. Unlike doing non-destructive view-port operations such as cropping or image contrast/brightness adjustments, image rotation can change the source data. A 180o rotation or an image flip does not change the data -- it just moves image pixels from one location to another. But a 90o rotation must account for non-integer pixel locations when converting the pixel mapping coordinates (unless the image is perfectly square). The problem is worse with image formats that have embedded compressions, such as JPEG. Each non-symmetric rotation distorts the image even more. A call for Reunion to rotate images before exporting therefore appears to be a call for Reunion to abandon any concerns about distorting the exported image relative to its source. It can be that such a request will cause more problems than the one problem that it is trying to solve.

              Finally, it seems that GEDCOM tags on images appear to be settings for the viewport for the image, not for the editing standards to apply to the image. If one genealogy application does an image view-port operation (rotation in this case) that is non-compliant with current GEDCOM tags, the complaint should not be for that application to export its non-compliance to other applications. It should be a call in one case for the application to stop supporting that GEDCOM non-compliant operation -- Reunion should not allow us to rotate images. Or, in another case, it should be a call to improve GEDCOM standards to allow for the currently non-compliant image view-port operation (image rotation should be supported with a GEDCOM rotation tag).

              Comment

              • reggoboy
                Member
                • Jan 2008
                • 109

                #8
                Regarding Case A (photos with an EXIF rotation flag):

                It's not necessarily a problem that TNG and others don't ignore the EXIF rotation flag. Without looking at that flag, and with Reunion not actually rotating the image, all those pictures would definitely display wrong at the destination. The problem is that the rotation is tied to the crop and size, and there's no rule about whether a picture should be rotated before or after its crop and size are applied.

                One could argue that importers could compensate. For example, TNG could offer a setting like "apply EXIF rotation before / after crop and size." But every importer would need its own version of that, and every user would have to know which setting matches their source program. That's a big ask.

                So the only reliable way to ensure the data transfers without corruption is for the source (Reunion) to make its interpretation explicit in the export. Since GEDCOM has no rotation tag, the only way to do that is for Reunion to rotate the exported copy of the image and remove the EXIF flag. Reunion's crop and size already match the upright image, so nothing else needs to change for Case A.
                Dave Kitabjian

                Comment

                • DrJJWMac
                  Member
                  • Dec 2015
                  • 71

                  #9
                  First, a bit of serious embarrassment. Rotation of rectangular images by integer multiples of 90o does not interpolate pixel "color"; it only moves pixels. My warnings about image destruction fall apart for such cases.

                  Also, the EXIF rotate tag is a marker telling an application how it should process for displaying the image. EXIF is not a marker that says that an application is to apply the operation at any step along the way. Nor is it a marker that says the image has been changed by that operation somewhere previously.

                  The other way for Reunion to export GEDCOM that will comply with existing GEDCOM standards and will not cause confusion in other programs is as follows: a) do not change the EXIF data at all and b) always reference any export GEDCOM crop coordinates to an unrotated image *even if Reunion has rotated the image in its viewport window*.

                  The onus is then on all applications to set a standard for GEDCOM import / export. Specifically in this case, GEDCOM CROP coordinates are referenced to the raw, source image frame, not to a rotated viewport frame in the application itself.

                  Here are two examples.

                  external image: portrait mode 600 high x 300 wide, no EXIF tags
                  -> import portrait mode, user rotates by 90o counter clockwise (creates a landscape view 300 x 600), user crops viewport from image viewport frame top+left to 200 x 400 size
                  export tags
                  SIZE: 600 x 300
                  CROP
                  TOP: 0, LEFT: 300
                  HEIGHT: 400, WIDTH: -200
                  -> import into TNG. TNG crops viewport by GEDCOM coordinates. Crop viewport is correct, but image is not rotated. User rotates image. Crop viewport rotates too.

                  external image: portrait mode 600 high x 300 wide, EXIF tag rotate 90o counter clockwise
                  -> import portrait mode + apply EXIF to rotate image (creates a landscape view 300 x 600), user crops viewport from image viewport frame top+left to 200 x 400 size
                  export tags
                  SIZE: 600 x 300
                  CROP
                  TOP: 0, LEFT: 300
                  HEIGHT: 400, WIDTH: -200
                  -> import into TNG. TNG ignores EXIF rotate tag. TNG crops viewport by GEDCOM coordinates. Crop viewport is correct, but image is not rotated. User rotates image. Crop viewport rotates too.
                  OR
                  -> import into TNG. TNG recognizes EXIF rotate tag. TNG crops viewport on unrotated image *because GEDCOM operations take priority over EXIF operations*. Then, TNG rotates the image and rotates the crop coordinates. User is happy!

                  --
                  JJW

                  Comment

                  • reggoboy
                    Member
                    • Jan 2008
                    • 109

                    #10
                    “The onus is then on all applications to set a standard for GEDCOM import / export”

                    The point is that there is no such standard TODAY and so today we have an ambiguity problem that can only be resolved by Reunion producing an unambiguous export.

                    I’m bowing out now because it feels like we’re wasting time. Hopefully the devs are clear about the problem and fix it. I think I’ve laid it out in good detail.
                    Dave Kitabjian

                    Comment

                    • DrJJWMac
                      Member
                      • Dec 2015
                      • 71

                      #11
                      I appreciate the discussions. We agree that a lack of GEDCOM standards for rotation is a serious problem. We disagree on how Reunion should fix this issue. Both our options can resolve the ambiguity (not only your approach or only my approach). As you say, it is now up to the developers.

                      Thanks!

                      --
                      JJW

                      Comment

                      Working...