Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for FocusPosition (Tag9402) in Sony RAW files (ARW) #582

Closed
cryptomilk opened this issue Dec 4, 2018 · 44 comments
Closed

Add support for FocusPosition (Tag9402) in Sony RAW files (ARW) #582

cryptomilk opened this issue Dec 4, 2018 · 44 comments
Milestone

Comments

@cryptomilk
Copy link
Collaborator

cryptomilk commented Dec 4, 2018

Please add support for reading the FocusPositon from ARW files.

This should be in Tag9402

exiftool 2018-10-16__7M34855.ARW | grep "Positon"
Focus Position 2                : 207

I can't read them with exiv2, it is needed to calculate the FocusDistance the correct vignetting for lensfun.

If you need an example file: https://xor.cryptomilk.org/darktable/ILCE-7M3/ColorCheckerSG/2018-10-17__7M34864.ARW

[UPDATE] Change from FocusDistance to FocusPosition which is a real tag.

@clanmills clanmills added this to the v0.28 milestone Dec 4, 2018
@clanmills
Copy link
Collaborator

I've copied your file here: http://exiv2.dyndns.org:8080/userContent/testfiles/582/

I wonder how Phil performs this trick! In this table:
https://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html

He shows Exif tag: 0x9206 | SubjectDistance which we also support. However that tag is not in your file! We'd report if were there!

Is this urgent? We're about to go into code-freeze for Exiv2 v0.27 which is scheduled to be released on December 28. A puzzle for 2019.

There's a discussion here which adds to the confusion in my mind. http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=7852.0

@cryptomilk
Copy link
Collaborator Author

0.27.1 would be enough, but I would love to have support for it and add it in darktable so I have correct lens corrections.

It looks like this is calculated by the FocusDistance2 and FocalLengthIn35mmFormat values.

http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,3688.0.html

The last post has the formula. The first 1.5 is the crop factor for APS-C so it should not be used and FocalLengthIn35mmFormat should be used for the calculation.

@clanmills
Copy link
Collaborator

Andreas:

I see Phil supports "Composite" Tags which are pseudo tags derived from other metadata: https://sno.phy.queensu.ca/~phil/exiftool/TagNames/Composite.html

Tag Writeable Derived from
HyperfocalDistance no FocalLength 
Aperture 
CircleOfConfusion
CircleOfConfusion no ScaleFactor35efl
ScaleFactor35efl no FocalLength 
FocalLengthIn35mmFormat
 Composite:DigitalZoom 
etc, etc, etc
(about another 10 items)

I didn't see the formula to calculate this in the link you gave, however I did find this https://www.plymouth.ac.uk/uploads/production/document/path/3/3754/PlymouthUniversity_MathsandStats_outreach_lenses.pdf

Exiv2 doesn't have "composite tags". Some metadata is protected and cannot be changed. For example the pixel row count Exif.Photo.PixelYDimension. So we could have "composite tags" which cannot be directly changed.

However "cooking up" metadata is a bad idea. Lens recognition generates more queries than anything else. The metadata concerning a lens is usually an integer in the makernotes and the same number is often used for several lenses. So, we have to deduce the lens by inspecting other metadata. For Exiv2 v0.26, I added a file ~/.exiv2 to provide a simple lookup: http://dev.exiv2.org/projects/exiv2/wiki/Lens_Recognition_in_Exiv2_v026_(and_later)/

The lens recognition code is written in C++. I have a long standing ambition to embed a language interpreter (eg ChaiScript) to enable users to modify lens recognition. Exiv2 could fetch updates to the scripts from exiv2.org. I've never had time to undertake that work. We could generate "derived tags" with such a feature.

I don't have good news for you. The plan for "dot" releases are security updates for the next couple of years. Exiv2 v0.28 will "modernise" the code to C++11 (or later). So we want to actively maintain Exiv2 v0.27 with security fixes while performing brain surgery on the code base. We want to write a new tiff parser to support BigTiff (64 bit tiff). The tiff parser is the heart of Exiv2 as Exif and Raw data are encoded in tiff format and embedded in the image.

I'll be 68 next month, and after 10+ years of service to Exiv2, want to reduce my effort to provide time for other hobbies such as running, travelling and music. I've assigned this issue to Milestone "Exiv2 v0.28" and Team Exiv2 will decide how to handle your request.

I know you will be disappointed in my reply, however I cannot commit other people to deal with this. The Open Source Community are engaged in a discussion about supporting Canon's new CR3 format. Canon have "stone walled" our requests for information. Canon cooperate with Adobe and others, however the Open Source Community will have to "reverse engineer" the format. As you know, the road of an open-source developer is long and winding! darktable-org/rawspeed#121 (comment)

@cryptomilk
Copy link
Collaborator Author

Quoting the JosR from the exiftool forums:

  1. For the DSLR-A580, I recently found FocusPosition info, also in Tag 0x0020 (MoreInfo - MoreSettings).
    However, in this case, the values range from appr. 80 to 255, with 255 indicating Infinity.
    For converting this FocusPosition into FocusDistance, I found that the formula mentioned in minolta.pm at WBInfoA100 - 0x49bb
    provided the best match for my series of A580 test shots with different focal lengths and at different distances:
    (1.5*2**($val/16-5) + 1) * FocalLength/1000
    This FocusPosition info is present in MoreSettings
    at offset 0x0029 for the DSLR-A450/A500/A550
    at offset 0x002b for the NEX-3/5/5C
    at offset 0x002f for the DSLR-A560/A580, SLT-A33/A35/A55V and NEX-C3/VG10E

So this is calculated from the "FocusPosition" which seems to be a real tag. Which means if that is exposed, I could use this in darktable to do the calculation there :-)

@cryptomilk
Copy link
Collaborator Author

My guess would be it is "Sony Tag9402 Tags":

https://sno.phy.queensu.ca/~phil/exiftool/TagNames/Sony.html

@cryptomilk
Copy link
Collaborator Author

cryptomilk commented Dec 5, 2018

So if I would get Exif.Sony.FocusDistance or whatever the tag would be, it could calculate it as:

(pow(2, <Exif.Sony.FocusDistance> / 16 - 5) + 1) * <Exif.Photo.FocalLengthIn35mmFilm> / 1000

@cryptomilk cryptomilk changed the title Add support for Focus Distance in Sony RAW files (ARW) Add support for FocusPosition (Tag9402) in Sony RAW files (ARW) Dec 5, 2018
@clanmills
Copy link
Collaborator

Yes. I saw that message about 0x0020. We don't seem to know about that one.

I'm up to my neck in debugging an ASAN issue on Ubuntu 14.04 with Clang 5.0.0 and I have three 32 bit issues to investigate for RC3 (which is scheduled for Friday). I promise to look at the 0x0020 business and see if I can safely get that into 0.27. If I get you the "raw" data and you finish the job, that's a great handshake.

I'll give you an update later in the week.

@cryptomilk
Copy link
Collaborator Author

Awesome, thanks Robin!!!

@clanmills
Copy link
Collaborator

clanmills commented Dec 5, 2018

Good News. I've found/fixed the clang/ubuntu14.04 horror and to celebrate I'm looking at your stuff. I've made a little progress. I will meet with Luis (on Slack) this evening to talk about RC3. He might volunteer to look at your issue while I finish the 32 bit weirdos.

I can find 0x2027 "FocusLocation":

610 rmills@rmillsmbp:/mmHD/Users/rmills/Jenkins/testfiles/582 $ exiv2 -pR 2018-10-17__7M34864.ARW | grep 2027
        6008 | 0x2027                              |     SHORT |        4 |      7402 | 6000 4000 3000 2000
611 rmills@rmillsmbp:/mmHD/Users/rmills/Jenkins/testfiles/582 $ 

What makes you think it's in tag 0x9402?

When I recursively dump your file, I see:

603 rmills@rmillsmbp:/mmHD/Users/rmills/Jenkins/testfiles/582 $ exiv2 -pR 2018-10-17__7M34864.ARW | grep -e II -e 9402
STRUCTURE OF TIFF FILE (II): 2018-10-17__7M34864.ARW
      34 | 0x010e ImageDescription             |     ASCII |       32 |       278 |                                
      46 | 0x010f Make                         |     ASCII |        5 |       310 | SONY
      58 | 0x0110 Model                        |     ASCII |        9 |       316 | ILCE-7M3
     118 | 0x0131 Software                     |     ASCII |       15 |       342 | ILCE-7M3 v2.00
     130 | 0x0132 DateTime                     |     ASCII |       20 |       358 | 2018:10:17 08:55:12
  STRUCTURE OF TIFF FILE (II): 2018-10-17__7M34864.ARW
  STRUCTURE OF TIFF FILE (II): 2018-10-17__7M34864.ARW
      4754 | 0x9003 DateTimeOriginal             |     ASCII |       20 |      5194 | 2018:10:17 08:55:12
      4766 | 0x9004 DateTimeDigitized            |     ASCII |       20 |      5214 | 2018:10:17 08:55:12
      4778 | 0x9010                              |     ASCII |        7 |      5234 | +01:00
      4790 | 0x9011                              |     ASCII |        7 |      5242 | +01:00
      4802 | 0x9012                              |     ASCII |        7 |      5250 | +01:00
    STRUCTURE OF TIFF FILE (II): 2018-10-17__7M34864.ARW
        5348 | 0x2003                              |     ASCII |      256 |      6588 | ............................... ...
        5492 | 0x3000                              | UNDEFINED |      390 |      6880 | II^...2018:10:17 08:55:12...p.. ...
        5504 | 0xb020                              |     ASCII |       16 |      7270 | Standard.......
        6308 | 0x9402                              | UNDEFINED |      400 |     12098 | l.............i.C.............. ...   <----
      5150 | 0xa434 LensModel                    |     ASCII |       16 |     42910 | FE 85mm F1.4 GM
   42990 | 0x010e ImageDescription             |     ASCII |       32 |     43138 |                                
   43002 | 0x010f Make                         |     ASCII |        5 |     43170 | SONY
   43014 | 0x0110 Model                        |     ASCII |        9 |     43176 | ILCE-7M3
   43074 | 0x0131 Software                     |     ASCII |       15 |     43202 | ILCE-7M3 v2.00
   43086 | 0x0132 DateTime                     |     ASCII |       20 |     43218 | 2018:10:17 08:55:12
604 rmills@rmillsmbp:/mmHD/Users/rmills/Jenkins/testfiles/582 $ 

I can extract the 400 bytes at offset 12098 with dd and format it with dmpf (my home-made od on steroids).

605 rmills@rmillsmbp:/mmHD/Users/rmills/Jenkins/testfiles/582 $ dd bs=1 skip=12098 count=400 if=2018-10-17__7M34864.ARW 2>/dev/null  | dmpf -
       0        0: l.............i.  ->   l 01 ff 00 88 00 04 d0 04 d3 e3 00 fb 9b  i 00
    0x10       16: C...............  ->   C 8a 89 05 00 00 d8 ea d7 08 dd 00 00 00 00 00
    0x20       32: ....R.R.8.8.....  ->  00 00 9a 81  R 1b  R 1b  8 1b  8 1b 14 14 0e 10
    0x30       48: ................  ->  ef 10 0e 10 ef 10 e4 01 e4 01 a3 b6 00 00 00 00
    0x40       64: ..1A......i.Q...  ->  f7 18  1  A 00 00 1b 00 00 00  i 00  Q 08 00 00
    0x50       80: ....}..}......l.  ->  00 00 e7 00  } 01 01  } 95 01 00 00 01 00  l 00
    0x60       96: l.t.....b.......  ->   l 00  t 00 00 00 00 00  b 01 f6 01 ef 10 00 c4
    0x70      112: .K..............  ->  ff  K 1b 9f bb 00 00 00 12 00 00 00 00 00 00 00
    0x80      128: ............}...  ->  00 00 00 00 00 00 f1 00 00 00 00 00  } 00 00 00
    0x90      144: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xa0      160: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xb0      176: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xc0      192: ...V............  ->  01 00 04  V 00 00 00 00 00 00 00 00 00 00 00 00
    0xd0      208: ..............r.  ->  00 00 00 00 00 00 07 ea 00 00 00 00 00 00  r c3
    0xe0      224: ..v.x...z.z.....  ->  93 c3  v c3  x c3 e7 10  z c3  z c3 00 00 00 00
    0xf0      240: ..@$..........z.  ->  12 ff  @  $ 00 00 00 00 00 00 00 00 00 00  z f3
   0x100      256: ......RRR...iii.  ->  d2 8e dd dd dd dd  R  R  R 00 00 00  i  i  i ea
   0x110      272: i....p..}.......  ->   i ea cd 00 00  p 00 00  } 00 00 00 ff ff c6 98
   0x120      288: ....h...h.......  ->  c6 98 c6 98  h 98 c6 98  h 98 c6 98 ff ff ff ff
   0x130      304: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x140      320: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x150      336: ................  ->  00 00 08 01 00 00 00 00 00 00 00 00 ff ff 00 18
   0x160      352: .............T))  ->  0c 8a 00 00 00 00 00 00 8e 10 00 d7 00  T  )  )
   0x170      368: }.........z.....  ->   } 01 e7 00 f1 97 8f 00 01 ff  z f3 d2 8e 1b 00
   0x180      384: ......@.....4...  ->  8a 00 00 00 00 01  @ 00 93 10 92 00  4 00 00 00
606 rmills@rmillsmbp:/mmHD/Users/rmills/Jenkins/testfiles/582 $ 

@cryptomilk
Copy link
Collaborator Author

cryptomilk commented Dec 5, 2018

I think FocusLocation is where in the image the focus was set. The first two values look like the image size and then the position in the image.

I've looked through the values of https://sno.phy.queensu.ca/~phil/exiftool/TagNames/Sony.html

The Tag904* seem to be latest additions and that made me guess it is one of those for the Sony a7 cameras. However I'm no expert in that area ...

The value in the RAW for FocusPosition is 140 (0x8c). Doesn't seem to be in that dump.

@clanmills
Copy link
Collaborator

Together we're going to solve this! What fun. We're both in the right place.

$ exiftool -v5 2018-10-17__7M34864.ARW
  | | | 83) Tag9402 (SubDirectory) -->
  | | |     - Tag 0x9402 (400 bytes, undef[400]):
  | | |         2f42: 6c 01 ff 00 88 00 04 d0 04 d3 e3 00 fb 9b 69 00 [l.............i.]  <-- same as dmpf!
  | | |         2f52: 43 8a 89 05 00 00 d8 ea d7 08 dd 00 00 00 00 00 [C...............]
...
  | | | + [BinaryData directory, 400 bytes]
  | | | | AmbientTemperature = 19
  | | | | - Tag 0x0004 (1 bytes, int8s[1]):
  | | | |     2f46: 13                                              [.]
  | | | | FocusMode = 6
  | | | | - Tag 0x0016, mask 0x7f (1 bytes, int8u[1]):
  | | | |     2f58: 06                                              [.]
  | | | | AFAreaMode = 12
  | | | | - Tag 0x0017 (1 bytes, int8u[1]):
  | | | |     2f59: 0c                                              [.]
  | | | | FocusPosition2 = 140
  | | | | - Tag 0x002d (1 bytes, int8u[1]):
  | | | |     2f6f: 8c                                              [.]
  | | | 84) Tag9403 (SubDirectory) -->
...

400 bytes What a coincidence? I don't think so. We're close.

@clanmills
Copy link
Collaborator

clanmills commented Dec 5, 2018

I've looked in Phil's code Sony.pm and the data is encrypted. Phil thanked David Coffin (dcraw), so I looked at his code, and found his decoder in C (I've pasted it below).

I suspect that when we decrypt the 400 bytes, we'll discover it's an IFD (tiff dictionary). I added a print statement to Phil's code and I believe the key is 1144201745. However he's using this to decrypt 42836 bytes from SR2SubIFD. I'm lost. I don't know what's going on!

Looking in the Exiv2 source, I don't see any evidence that this decoder is present. So, for now, this data appears to be hidden from Exiv2.

I wrote a little command-line decoder. This doesn't generate the data that Phil shows in his -v5 output when start ==0 (which Phil also appeared to use).

We can't add this to Exiv2 as we're only a couple of days from code freeze for Exiv2 v0.27.

#include <iostream>

void sony_decrypt (unsigned *data, int len, int start, int key)
{
  static unsigned pad[128], p;

  if (start) {
    for (p=0; p < 4; p++)
      pad[p] = key = key * 48828125 + 1;
    pad[3] = pad[3] << 1 | (pad[0]^pad[2]) >> 31;
    for (p=4; p < 127; p++)
      pad[p] = (pad[p-4]^pad[p-2]) << 1 | (pad[p-3]^pad[p-1]) >> 31;
    for (p=0; p < 127; p++)
      pad[p] = htonl(pad[p]);
  }
  while (len-- && p++)
    *data++ ^= pad[(p-1) & 127] = pad[p & 127] ^ pad[(p+64) & 127];
}

int main(int argc, const char* argv[])
{
    int key = 1144201745;
    int start = 0;
    sony_decrypt(NULL,0,1,key); // initialise the decrypter

    if (argc != 3 ) {
        std::cout << "syntax: " << argv[0] << " in-file" << " out-file" << std::endl;
    } else {
        FILE* in  = fopen(argv[1],"r");
        FILE* out = fopen(argv[2],"w");
        if ( in && out ) {
            unsigned buffer[2000];
            int n = fread(buffer,sizeof(unsigned),2000,in);
            sony_decrypt(buffer,n,start,key);
            fwrite(buffer,sizeof(unsigned),n,out);
        } else {
            if ( !in  ) std::cout << "unable to open input file "  << argv[1] << std::endl;
            if ( !out ) std::cout << "unable to open output file " << argv[2] << std::endl;
        }
        if ( in  ) fclose(in);
        if ( out ) fclose(out);
    }

    return 0;
}

@cryptomilk
Copy link
Collaborator Author

I thought this was easier to get but I understand if it needs much more changes that it needs to be postponed. Thanks for looking into it!

@boardhead
Copy link
Collaborator

boardhead commented Dec 14, 2018

The FocusPosition2 tag in the sample ILCE-7M3 file is in Sony tag 0x9402, which is enciphered using a simple substitution cipher that I uncovered (not encrypted using the algorithm mentioned that was uncovered by David Coffin). The decipher formula is simply out = (in * in * in) % 249 for each byte. Many other Sony tags use this same cipher. Once deciphered, the data is a straight binary structure (not an IFD). Some other models store FocusPosition metadata in tag 0x9404, which is enciphered in the same way.

However, yet other models store the FocusPosition in tag 0x0020, which is not enciphered or encrypted, but for some models this is formatted in a proprietary directory structure which requires specialized decoding.

Edit: Sorry, the formula I gave is for enciphering. Deciphering is the reverse.

@clanmills
Copy link
Collaborator

Thanks, Phil. I hope everything's good with you. We're on track for v0.27 on 28 December. And that's me finished with C++. I'm going to deal with users and releases and stuff going forward.

Before I went hunting and found the DC code, I thought it was a simple lookup/substitution filter. It's not much more than that.

Incidentally, I still haven't dealt with Exif > 64k in JPEGs and read your comments about that and noted them here. http://dev.exiv2.org/issues/1232 Do you have a sample JPEG that has > 64k Exif data?

@clanmills
Copy link
Collaborator

clanmills commented Dec 15, 2018

@cryptomilk This isn't going into Exiv2 v0.27 which will be released on 28 December 2018. I've implemented Phil's decoder as follows:

#include <iostream>
#include <stdio.h>

/*
#------------------------------------------------------------------------------
# Decipher/encipher Sony tag 0x94xx data (ref PH)
# Inputs: 0) data reference, 1) true to encipher the data
sub Decipher($;$)
{
    my ($dataPt, $encipher) = @_;
    # This is a simple substitution cipher, so use a hardcoded translation table for speed.
    # The formula is: $c = ($b*$b*$b) % 249, where $c is the enciphered data byte
    # (note that bytes with values 249-255 are not translated, and 0-1, 82-84,
    #  165-167 and 248 have the same enciphered value)
    if ($encipher) {    # encipher
        $$dataPt =~ tr/\x02-\xf7/\x08\x1b\x40\x7d\xd8\x5e\x0e\xe7\x04V\xea\...;
    } else {            # decipher
        $$dataPt =~ tr/\x08\x1b\x40\x7d\xd8\x5e\x0e\xe7\x04V\xea\xcd\x05\x8ap\...;
    }
}
*/

void dump(const char* message,unsigned char* crypt)
{
    std::cout << message ;
    char buffer[20];

    for ( int i = 0 ; i < 16 ; i++ ) {
        sprintf(buffer,"   %x ",i);
        std::cout << buffer ;
    }
    std::cout << std::endl;

    for ( int i = 0 ; i < 16 ; i++ ) {
        sprintf(buffer,"%3d %02x: ",i*16,i*16);
        std::cout << buffer ;
        for ( int j = 0 ; j < 16 ; j++ ) {
            int k = i*16 + j;
            sprintf(buffer,"0x%02x ",crypt[k]);
            std::cout << buffer;
        }
        std::cout << std::endl;
    }
}

void sony_decrypt (unsigned char* data, int len, int start)
{
    static unsigned char encrypt[256];
    static unsigned char decrypt[256];
    if ( data && start == 0 && len ) {
       int i = 0;
        while ( i < len ) {
            data[i] = decrypt[data[i]];
            i++;
        }
    } else {
        for ( int i = 0 ; i < 256 ; i++ ) {
            encrypt[i] = (i * i * i) % 249;
        }

        for ( int i = 249 ; i < 256 ; i++ ) {
            encrypt[i]=255-i;
        }

        for ( int i = 0 ; i < 256 ; i++)
            decrypt[encrypt[i]] = i;
        decrypt[0]=0;
        encrypt[0]=0;
    }

    if ( len < 0 ) {
        dump("encrypt:",encrypt);
        dump("decrypt:",decrypt);
        printf("Pass: ");
        for ( int i = 0 ; i < 256 ; i++ ) {
            if ( decrypt[i] == i ) {
        	    printf("%d (0x%02x) ",i,i);
        	    if ( encrypt[i] != i ) {
        		    printf("*%d* ",i) ;
        	    }
        	}
        }
        std::cout << std::endl;
    }
}

int main(int argc, const char* argv[])
{
    sony_decrypt(NULL,0,1); // initialise the decrypter

    if ( argc == 2 ) {
        sony_decrypt(NULL,-1,1); // dump the tables;
    } else if (argc != 3 ) {
        std::cout << "syntax: " << argv[0] << " in-file" << " out-file" << std::endl;
    } else {
        FILE* in  = strcmp(argv[1],"-")==0 ? stdin  : fopen(argv[1],"r");
        FILE* out = strcmp(argv[2],"-")==0 ? stdout : fopen(argv[2],"w");
        if ( in && out ) {
            unsigned char buffer[2000];
            int      n = fread(buffer,sizeof(unsigned char),2000,in);
            sony_decrypt(buffer,n,0);
            fwrite(buffer,sizeof(unsigned char),n,out);
        } else {
            if ( !in  ) std::cout << "unable to open input file "  << argv[1] << std::endl;
            if ( !out ) std::cout << "unable to open output file " << argv[2] << std::endl;
        }
        if ( in  ) if (  in != stdin  ) fclose( in);
        if ( out ) if ( out != stdout ) fclose(out);
    }

    return 0;
}

The encrypted data that I found in your file is exactly as reported by Phil and I believe I've decrypted it correctly:

913 rmills@rmillsmbp:~/temp $ dd bs=1 skip=12098 count=400 if=2018-10-17__7M34864.ARW 2>/dev/null | tee /tmp/dd | dmpf - ; echo ' ' ; cat /tmp/dd | ./decode - - | dmpf - 
       0        0: l.............i.  ->  6c 01 ff 00 88 00 04 d0 04 d3 e3 00 fb 9b 69 00
    0x10       16: C...............  ->  43 8a 89 05 00 00 d8 ea d7 08 dd 00 00 00 00 00
    0x20       32: ....R.R.8.8.....  ->  00 00 9a 81 52 1b 52 1b 38 1b 38 1b 14 14 0e 10
    0x30       48: ................  ->  ef 10 0e 10 ef 10 e4 01 e4 01 a3 b6 00 00 00 00
    0x40       64: ..1A......i.Q...  ->  f7 18 31 41 00 00 1b 00 00 00 69 00 51 08 00 00
    0x50       80: ....}..}......l.  ->  00 00 e7 00 7d 01 01 7d 95 01 00 00 01 00 6c 00
    0x60       96: l.t.....b.......  ->  6c 00 74 00 00 00 00 00 62 01 f6 01 ef 10 00 c4
    0x70      112: .K..............  ->  ff 4b 1b 9f bb 00 00 00 12 00 00 00 00 00 00 00
    0x80      128: ............}...  ->  00 00 00 00 00 00 f1 00 00 00 00 00 7d 00 00 00
    0x90      144: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xa0      160: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xb0      176: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xc0      192: ...V............  ->  01 00 04 56 00 00 00 00 00 00 00 00 00 00 00 00
    0xd0      208: ..............r.  ->  00 00 00 00 00 00 07 ea 00 00 00 00 00 00 72 c3
    0xe0      224: ..v.x...z.z.....  ->  93 c3 76 c3 78 c3 e7 10 7a c3 7a c3 00 00 00 00
    0xf0      240: ..@$..........z.  ->  12 ff 40 24 00 00 00 00 00 00 00 00 00 00 7a f3
   0x100      256: ......RRR...iii.  ->  d2 8e dd dd dd dd 52 52 52 00 00 00 69 69 69 ea
   0x110      272: i....p..}.......  ->  69 ea cd 00 00 70 00 00 7d 00 00 00 ff ff c6 98
   0x120      288: ....h...h.......  ->  c6 98 c6 98 68 98 c6 98 68 98 c6 98 ff ff ff ff
   0x130      304: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x140      320: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x150      336: ................  ->  00 00 08 01 00 00 00 00 00 00 00 00 ff ff 00 18
   0x160      352: .............T))  ->  0c 8a 00 00 00 00 00 00 8e 10 00 d7 00 54 29 29
   0x170      368: }.........z.....  ->  7d 01 e7 00 f1 97 8f 00 01 ff 7a f3 d2 8e 1b 00
   0x180      384: ......@.....4...  ->  8a 00 00 00 00 01 40 00 93 10 92 00 34 00 00 00
 
       0        0: .......X."A.....  ->  1e fe 00 00 13 00 fb 58 fb 22 41 00 00 f2 12 00
    0x10       16: ..........b.....  ->  e8 0f e9 fa 00 00 06 0c 17 02 62 00 00 00 00 00
    0x20       32: ....R.R.P.P....d  ->  00 00 8b 18 52 03 52 03 50 03 50 03 8c 8c 08 64
    0x30       48: /d.d/d..........  ->  2f 64 08 64 2f 64 8d fe 8d fe ee 11 00 00 00 00
    0x40       64: .ij\........!...  ->  c7 69 6a 5c 00 00 03 00 00 00 12 00 21 02 00 00
    0x50       80: ........ .......  ->  00 00 09 00 05 fe fe 05 20 fe 00 00 fe 00 1e 00
    0x60       96: ..M.....G.H./d.@  ->  1e 00 4d 00 00 00 00 00 47 fe 48 fe 2f 64 00 40
    0x70      112: .Q.~............  ->  00 51 03 7e 19 00 00 00 f0 00 00 00 00 00 00 00
    0x80      128: ................  ->  00 00 00 00 00 00 f7 00 00 00 00 00 05 00 00 00
    0x90      144: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xa0      160: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xb0      176: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xc0      192: ................  ->  fe 00 fb 0b 00 00 00 00 00 00 00 00 00 00 00 00
    0xd0      208: ......(........c  ->  00 00 00 00 00 00 28 0c 00 00 00 00 00 00 cf 63
    0xe0      224: Wc.c.c.d.c.c....  ->  57 63 91 63 e1 63 09 64 b3 63 b3 63 00 00 00 00
    0xf0      240: ...0...........r  ->  f0 00 04 30 00 00 00 00 00 00 00 00 00 00 b3 72
   0x100      256: .=bbbbRRR.......  ->  99 3d 62 62 62 62 52 52 52 00 00 00 12 12 12 0c
   0x110      272: ................  ->  12 0c 0d 00 00 10 00 00 05 00 00 00 00 00 ba 9e
   0x120      288: ................  ->  ba 9e ba 9e bf 9e ba 9e bf 9e ba 9e 00 00 00 00
   0x130      304: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x140      320: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x150      336: ...............i  ->  00 00 02 fe 00 00 00 00 00 00 00 00 00 00 00 69
   0x160      352: ........=d...T..  ->  1b 0f 00 00 00 00 00 00 3d 64 00 17 00 54 a1 a1
   0x170      368: ...........r.=..  ->  05 fe 09 00 f7 b2 d4 00 fe 00 b3 72 99 3d 03 00
   0x180      384: ........Wd......  ->  0f 00 00 00 00 fe 04 00 57 64 1a 00 d0 00 00 00
914 rmills@rmillsmbp:~/temp $ 

Exiftool -v5 output:

  | | | 83) Tag9402 (SubDirectory) -->
  | | |     - Tag 0x9402 (400 bytes, undef[400]):
  | | |         2f42: 6c 01 ff 00 88 00 04 d0 04 d3 e3 00 fb 9b 69 00 [l.............i.]
  | | |         2f52: 43 8a 89 05 00 00 d8 ea d7 08 dd 00 00 00 00 00 [C...............]
  | | |         2f62: 00 00 9a 81 52 1b 52 1b 38 1b 38 1b 14 14 0e 10 [....R.R.8.8.....]
  | | |         2f72: ef 10 0e 10 ef 10 e4 01 e4 01 a3 b6 00 00 00 00 [................]
  | | |         2f82: f7 18 31 41 00 00 1b 00 00 00 69 00 51 08 00 00 [..1A......i.Q...]
  | | |         2f92: 00 00 e7 00 7d 01 01 7d 95 01 00 00 01 00 6c 00 [....}..}......l.]
  | | |         2fa2: 6c 00 74 00 00 00 00 00 62 01 f6 01 ef 10 00 c4 [l.t.....b.......]
  | | |         2fb2: ff 4b 1b 9f bb 00 00 00 12 00 00 00 00 00 00 00 [.K..............]
  | | |         2fc2: 00 00 00 00 00 00 f1 00 00 00 00 00 7d 00 00 00 [............}...]
  | | |         2fd2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | |         2fe2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | |         2ff2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | |         3002: 01 00 04 56 00 00 00 00 00 00 00 00 00 00 00 00 [...V............]
  | | |         3012: 00 00 00 00 00 00 07 ea 00 00 00 00 00 00 72 c3 [..............r.]
  | | |         3022: 93 c3 76 c3 78 c3 e7 10 7a c3 7a c3 00 00 00 00 [..v.x...z.z.....]
  | | |         3032: 12 ff 40 24 00 00 00 00 00 00 00 00 00 00 7a f3 [..@$..........z.]
  | | |         3042: d2 8e dd dd dd dd 52 52 52 00 00 00 69 69 69 ea [......RRR...iii.]
  | | |         3052: 69 ea cd 00 00 70 00 00 7d 00 00 00 ff ff c6 98 [i....p..}.......]
  | | |         3062: c6 98 c6 98 68 98 c6 98 68 98 c6 98 ff ff ff ff [....h...h.......]
  | | |         3072: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | |         3082: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | |         3092: 00 00 08 01 00 00 00 00 00 00 00 00 ff ff 00 18 [................]
  | | |         30a2: 0c 8a 00 00 00 00 00 00 8e 10 00 d7 00 54 29 29 [.............T))]
  | | |         30b2: 7d 01 e7 00 f1 97 8f 00 01 ff 7a f3 d2 8e 1b 00 [}.........z.....]
  | | |         30c2: 8a 00 00 00 00 01 40 00 93 10 92 00 34 00 00 00 [......@.....4...]
  | | | + [Deciphered Tag9402 directory]
  | | | |       2f42: 1e 01 ff 00 13 00 0a 58 0a 22 41 00 fb f2 12 00 [.......X."A.....]
  | | | |       2f52: e8 0f e9 0e 00 00 06 0c 17 02 62 00 00 00 00 00 [..........b.....]
  | | | |       2f62: 00 00 8b 18 52 03 52 03 50 03 50 03 8c 8c 08 64 [....R.R.P.P....d]
  | | | |       2f72: 2f 64 08 64 2f 64 8d 01 8d 01 ee 11 00 00 00 00 [/d.d/d..........]
  | | | |       2f82: c7 69 6a 5c 00 00 03 00 00 00 12 00 21 02 00 00 [.ij\........!...]
  | | | |       2f92: 00 00 09 00 05 01 01 05 20 01 00 00 01 00 1e 00 [........ .......]
  | | | |       2fa2: 1e 00 4d 00 00 00 00 00 47 01 48 01 2f 64 00 40 [..M.....G.H./d.@]
  | | | |       2fb2: ff 51 03 7e 19 00 00 00 f0 00 00 00 00 00 00 00 [.Q.~............]
  | | | |       2fc2: 00 00 00 00 00 00 f7 00 00 00 00 00 05 00 00 00 [................]
  | | | |       2fd2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | | |       2fe2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | | |       2ff2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | | |       3002: 01 00 0a 0b 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | | |       3012: 00 00 00 00 00 00 28 0c 00 00 00 00 00 00 cf 63 [......(........c]
  | | | |       3022: 57 63 91 63 e1 63 09 64 b3 63 b3 63 00 00 00 00 [Wc.c.c.d.c.c....]
  | | | |       3032: f0 ff 04 30 00 00 00 00 00 00 00 00 00 00 b3 72 [...0...........r]
  | | | |       3042: 99 3d 62 62 62 62 52 52 52 00 00 00 12 12 12 0c [.=bbbbRRR.......]
  | | | |       3052: 12 0c 0d 00 00 10 00 00 05 00 00 00 ff ff ba 9e [................]
  | | | |       3062: ba 9e ba 9e bf 9e ba 9e bf 9e ba 9e ff ff ff ff [................]
  | | | |       3072: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | | |       3082: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | | |       3092: 00 00 02 01 00 00 00 00 00 00 00 00 ff ff 00 69 [...............i]
  | | | |       30a2: 1b 0f 00 00 00 00 00 00 3d 64 00 17 00 54 a1 a1 [........=d...T..]
  | | | |       30b2: 05 01 09 00 f7 b2 d4 00 01 ff b3 72 99 3d 03 00 [...........r.=..]
  | | | |       30c2: 0f 00 00 00 00 01 04 00 57 64 1a 00 d0 00 00 00 [........Wd......]

@boardhead
Copy link
Collaborator

boardhead commented Dec 18, 2018

Hi Robin,

Your deciphered data is correct up to byte 100 or so, and after that is hasn't been deciphered.

Here is a sample mult-segment EXIF file for you: http://130.15.24.88/~phil/tmp/multi-segment_exif.jpg

@clanmills
Copy link
Collaborator

clanmills commented Dec 18, 2018

I've fixed the code. I was read/writing unsigned which should be unsigned char. More eyes make all the difference!

And thank you for the test JPG with Exif data > 64k. I suspect implmentation will be easy.

@clanmills clanmills modified the milestones: v0.28, v0.27.1 Jan 15, 2019
@clanmills
Copy link
Collaborator

@cryptomilk I've done a lot of work this week on #646 and learned lots about the TiffReader. I'm confident that I know how to fix this issue in Exiv2 and assigned it to Milestone 0.27.1 (scheduled for 2019-03-31). Thank You very much for the work you have done on Exiv2 (and libssh). I'll update this issue report with progress on the implementation.

@cryptomilk
Copy link
Collaborator Author

Awesome, thanks!

@cryptomilk
Copy link
Collaborator Author

Is this still planned for 0.27.1?

@D4N
Copy link
Member

D4N commented Mar 11, 2019 via email

@cryptomilk
Copy link
Collaborator Author

Then you should change then milestone :-)

@D4N D4N modified the milestones: v0.27.1, v0.27.2 Mar 12, 2019
@D4N
Copy link
Member

D4N commented Mar 12, 2019

Indeed, moved to the next one.

@clanmills
Copy link
Collaborator

Thanks @cryptomilk That's a splendid offer. We're in Scotland that weekend on family business that cannot be changed. I attended LGM in London in 2016 and gave a remote presentation in Rio in 2017. That's a real pity as I would very much like to meet you.

Thanks @D4N. I'm going to focus on the release and website. Once that's working, I'll investigate patches for #646 and #582. You'll be really impressed with how this is achieved. Andreas Huggel's design of the TiffVisitor is ingenious.

My aim is to stick to the schedule and release v0.27.1 at the end of March. #646 and #582 are lower priority and can be deferred.

@boardhead
Copy link
Collaborator

I feel for you Robin, and sympathize with your git frustration.

@cryptomilk
Copy link
Collaborator Author

@clanmills I can give you a guide through git (video chat), if you're interested :-)

@clanmills
Copy link
Collaborator

Phil: Yip, it's almost impossible to understand git on your own. I talked to the cat about it, but she doesn't get git either.

@cryptomilk Thanks. I'd like to take up your offer and here's my suggestion. I fixed something yesterday for somebody and I'd like to submit a PR to branch 0.27-maintenance. It's a one line fix. Tomorrow, I'd like to update the test harness to block a regression. So, on Sunday evening could you "talk me down" (give me the commands)? I'll type them into the computer. I'd like to finish 0.27.1 RC1 early next week. So, if I understand your recipe, I can submit PRs for 3 or 4 matters which are to be fixed for 0.27.1 RC1.

I've sent an invitation to join the Exiv2 Slack channel. Or we can chat on Skype, or Messenger or even the phone! Let me know. Thanks for offering to help me with this.

@clanmills
Copy link
Collaborator

clanmills commented May 21, 2019

Folks

I've reduced git to 5 commands and wrote them on a little card. The weird brown marks were added by the cat (don't ask how).

GitIdiotCard

I hope to get the fix for this issue (FocusPositionARW) into v0.27.2 which is on-track to ship on 2019-06-30. I'll do the code for this in early June when I get back from Scotland.

@clanmills clanmills modified the milestones: v0.27.2, v0.27.3 Jun 11, 2019
@clanmills
Copy link
Collaborator

clanmills commented Jun 11, 2019

I've almost got this working and I will submit a PR which passes the test suite.

I don't believe the decrypt is working correctly. I've successfully added the binary array handler.

Decryption code

#include <iostream>

#define byte unsigned char

int main(int argc, const char* argv[])
{
    // initialize the code table
    byte  code[256];
    for ( uint32_t i = 0 ; i < 249 ; i++ ) {
        code[i] = (i * i * i) % 249 ;
    }
    for ( uint32_t i = 249 ; i < 256 ; i++ ) {
        code[i] = i;
    }

    if (argc == 1) {
        for ( int i = 0 ; i < 256 ; i++ ) {
            printf("%-3d %#4x   -> %-3d %#4x%s\n",i,i,code[i],code[i],(code[i] == i ? " MATCH" : ""));
        }
        return 0;
    }

    if (argc != 3 ) {
        std::cout << "syntax: " << argv[0] << " in-file" << " out-file" << std::endl;
    } else {
        FILE* in  = fopen(argv[1],"r");
        FILE* out = fopen(argv[2],"w");
        if ( in && out ) {
            byte           buffer  [2000];
            int  n = fread(buffer,1,2000,in);
            // encode byte-by-byte
            for ( int i = 0 ; i < n ; i++ ) {
                buffer[i]=code[buffer[i]];
            }
            fwrite(buffer,1,n,out);
        } else {
            if ( !in  ) std::cout << "unable to open input file "  << argv[1] << std::endl;
            if ( !out ) std::cout << "unable to open output file " << argv[2] << std::endl;
        }
        if ( in  ) fclose(in);
        if ( out ) fclose(out);
    }

    return 0;
}

This isn't correct. When it decodes the data from test file, the decoded data is similar to Phil's. However it's not the same!

Adding a binary array handler:

src/sonymn_int.hpp           TagInfo tagInfoFp(); TagInfo tagInfoFp_() ;DataBuf sonyFpCrypt(...);
src/sonymn_int.cpp           ... implementation ... 
src/tags_int.hpp             declare sony2FpId
src/tags_int.cpp             add { sony2FpId,       "Makernote", "Sony2Fp",      SonyMakerNote::tagListFp       }
src/tiffimage_int.cpp        { Tag::root, sony2FpId,        sony2Id,          0x9402    },
                             {  Tag::all, sony2FpId,        newTiffBinaryElement                      },
                             {    0x9402, sony2Id,          EXV_BINARY_ARRAY(sony2FpCfg, sony2FpDef)  },
                             extern const ArrayCfg sony2FpCfg = {
                                 sony2FpId,        // Group for the elements
                                 invalidByteOrder, // Inherit from parent
                                 ttUndefined,      // Type for array entry and size element
                                 sonyFpCrypt,      // (uint16_t, const byte*, uint32_t, TiffComponent* const);
                                 false,            // No size element
                                 false,            // No fillers
                                 false,            // Don't concatenate gaps
                                 { 0, ttUnsignedShort, 1 }
                             };
                             extern const ArrayDef sony2FpDef[] = {
                                 {  0x4, ttSignedByte  , 1 }, // Exif.Sony1Fp.AmbientTemperature
                                 { 0x16, ttUnsignedByte, 1 }, // Exif.Sony1Fp.FocusMode
                                 { 0x17, ttUnsignedByte, 1 }, // Exif.Sony1Fp.AFAreaMode
                                 { 0x2d, ttUnsignedByte, 1 }  // Exif.Sony1Fp.FocusPosition2
                             };

I hope we can get this fixed for Exiv2 v0.27.2

@cryptomilk
Copy link
Collaborator Author

I'm looking forward to v0.27.2

@boardhead
Copy link
Collaborator

Your formula is correct. Are you perhaps enciphering instead of deciphering? I think you need to reverse the direction of your cipher.

@clanmills
Copy link
Collaborator

@boardhead Thanks for your input. It must be something like that, however I haven't discovered my blunder yet! I want to release v0.27.2-RC1 today or tomorrow and spend more time on this puzzle next week. We're going to Normandy on Friday to run in the D-Day Half Marathon on Sunday.

@boardhead
Copy link
Collaborator

Try changing this line

    code[i] = (i * i * i) % 249 ;

to this

    code[(i * i * i) % 249] =  i;

@clanmills
Copy link
Collaborator

clanmills commented Jun 12, 2019

@boardhead You are a Genius. Looking forward to meeting in Canada in July 2020. Thank You very much.

845 rmills@rmillsmm-local:~/Andreas $ make decrypt ; ./decrypt raw.data real.data ; dmpf real.data ; 
make: `decrypt' is up to date.
       0        0: .......X."A.....  ->  1e 01 ff 00 13 00 0a 58 0a 22 41 00 fb f2 12 00
    0x10       16: ..........b.....  ->  e8 0f e9 0e 00 00 06 0c 17 02 62 00 00 00 00 00
    0x20       32: ....R.R.P.P....d  ->  00 00 8b 18 52 03 52 03 50 03 50 03 8c 8c 08 64
    0x30       48: /d.d/d..........  ->  2f 64 08 64 2f 64 8d 01 8d 01 ee 11 00 00 00 00
    0x40       64: .ij\........!...  ->  c7 69 6a 5c 00 00 03 00 00 00 12 00 21 02 00 00
    0x50       80: ........ .......  ->  00 00 09 00 05 01 01 05 20 01 00 00 01 00 1e 00
    0x60       96: ..M.....G.H./d.@  ->  1e 00 4d 00 00 00 00 00 47 01 48 01 2f 64 00 40
    0x70      112: .Q.~............  ->  ff 51 03 7e 19 00 00 00 f0 00 00 00 00 00 00 00
    0x80      128: ................  ->  00 00 00 00 00 00 f7 00 00 00 00 00 05 00 00 00
    0x90      144: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xa0      160: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xb0      176: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    0xc0      192: ................  ->  01 00 0a 0b 00 00 00 00 00 00 00 00 00 00 00 00
    0xd0      208: ......(........c  ->  00 00 00 00 00 00 28 0c 00 00 00 00 00 00 cf 63
    0xe0      224: Wc.c.c.d.c.c....  ->  57 63 91 63 e1 63 09 64 b3 63 b3 63 00 00 00 00
    0xf0      240: ...0...........r  ->  f0 ff 04 30 00 00 00 00 00 00 00 00 00 00 b3 72
   0x100      256: .=bbbbRRR.......  ->  99 3d 62 62 62 62 52 52 52 00 00 00 12 12 12 0c
   0x110      272: ................  ->  12 0c 0d 00 00 10 00 00 05 00 00 00 ff ff ba 9e
   0x120      288: ................  ->  ba 9e ba 9e bf 9e ba 9e bf 9e ba 9e ff ff ff ff
   0x130      304: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x140      320: ................  ->  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
   0x150      336: ...............i  ->  00 00 02 01 00 00 00 00 00 00 00 00 ff ff 00 69
   0x160      352: ........=d...T..  ->  1b 0f 00 00 00 00 00 00 3d 64 00 17 00 54 a1 a1
   0x170      368: ...........r.=..  ->  05 01 09 00 f7 b2 d4 00 01 ff b3 72 99 3d 03 00
   0x180      384: ........Wd......  ->  0f 00 00 00 00 01 04 00 57 64 1a 00 d0 00 00 00
846 rmills@rmillsmm-local:~/Andreas $ 

And ExifTool reports:

  | | | + [Deciphered Tag9402 directory]
  | | | |       2f42: 1e 01 ff 00 13 00 0a 58 0a 22 41 00 fb f2 12 00 [.......X."A.....]
  | | | |       2f52: e8 0f e9 0e 00 00 06 0c 17 02 62 00 00 00 00 00 [..........b.....]
  | | | |       2f62: 00 00 8b 18 52 03 52 03 50 03 50 03 8c 8c 08 64 [....R.R.P.P....d]
  | | | |       2f72: 2f 64 08 64 2f 64 8d 01 8d 01 ee 11 00 00 00 00 [/d.d/d..........]
  | | | |       2f82: c7 69 6a 5c 00 00 03 00 00 00 12 00 21 02 00 00 [.ij\........!...]
  | | | |       2f92: 00 00 09 00 05 01 01 05 20 01 00 00 01 00 1e 00 [........ .......]
  | | | |       2fa2: 1e 00 4d 00 00 00 00 00 47 01 48 01 2f 64 00 40 [..M.....G.H./d.@]
  | | | |       2fb2: ff 51 03 7e 19 00 00 00 f0 00 00 00 00 00 00 00 [.Q.~............]
  | | | |       2fc2: 00 00 00 00 00 00 f7 00 00 00 00 00 05 00 00 00 [................]
  | | | |       2fd2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | | |       2fe2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | | |       2ff2: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | | |       3002: 01 00 0a 0b 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | | |       3012: 00 00 00 00 00 00 28 0c 00 00 00 00 00 00 cf 63 [......(........c]
  | | | |       3022: 57 63 91 63 e1 63 09 64 b3 63 b3 63 00 00 00 00 [Wc.c.c.d.c.c....]
  | | | |       3032: f0 ff 04 30 00 00 00 00 00 00 00 00 00 00 b3 72 [...0...........r]
  | | | |       3042: 99 3d 62 62 62 62 52 52 52 00 00 00 12 12 12 0c [.=bbbbRRR.......]
  | | | |       3052: 12 0c 0d 00 00 10 00 00 05 00 00 00 ff ff ba 9e [................]
  | | | |       3062: ba 9e ba 9e bf 9e ba 9e bf 9e ba 9e ff ff ff ff [................]
  | | | |       3072: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | | |       3082: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | | | |       3092: 00 00 02 01 00 00 00 00 00 00 00 00 ff ff 00 69 [...............i]
  | | | |       30a2: 1b 0f 00 00 00 00 00 00 3d 64 00 17 00 54 a1 a1 [........=d...T..]
  | | | |       30b2: 05 01 09 00 f7 b2 d4 00 01 ff b3 72 99 3d 03 00 [...........r.=..]
  | | | |       30c2: 0f 00 00 00 00 01 04 00 57 64 1a 00 d0 00 00 00 [........Wd......]

@clanmills
Copy link
Collaborator

@cryptomilk The code for this has been submitted to branches 'master' and '0.27-maintenance'. Could you test this, please? If you're happy, please close this issue.

I've enjoyed working with you and @boardhead on this issue. I always enjoy working with @piponazo and @D4N.

@clanmills
Copy link
Collaborator

@cryptomilk Are you OK for me to close this? The fix will ship in 0.27.2 which is PR #940. I hope to release 0.27.2 today.

@cryptomilk
Copy link
Collaborator Author

Yes, I've already implemented support for it in darktable! :-)

@cryptomilk
Copy link
Collaborator Author

Thanks!!!

@clanmills
Copy link
Collaborator

Yes. I remember looking at your code in darktable that uses the macro EXIV2_TEST_VERSION.

Very pleased with how everything has worked out and how well we've all pulled together on this issue.

@clanmills
Copy link
Collaborator

#906

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants