Project

General

Profile

Patch #919 » samsung.diff

patch to support Pentax-style metadata in "Samsung" JPEG files. - Michael Karcher, 29 Aug 2013 05:24

View differences:

exiv2-0.23-fixed/src/makernote.cpp 2013-08-29 13:41:28.000000000 +0200
902 902
    TiffComponent* newSamsungMn(uint16_t    tag,
903 903
                                IfdId       group,
904 904
                                IfdId       mnGroup,
905
                                const byte* /*pData*/,
905
                                const byte* pData,
906 906
                                uint32_t    size,
907 907
                                ByteOrder   /*byteOrder*/)
908 908
    {
909
        // Require at least an IFD with 1 entry
910
        if (size < 18) return 0;
911
        return newSamsungMn2(tag, group, mnGroup);
909
        if (   size > 4
910
            && std::string(reinterpret_cast<const char*>(pData), 4) == std::string("AOC\0", 4)) {
911
            // Samsung branded Pentax camera:
912
            // Require at least the header and an IFD with 1 entry
913
            if (size < PentaxMnHeader::sizeOfSignature() + 18) return 0;
914
            return newPentaxMn2(tag, group, pentaxId);
915
        }
916
        else {
917
            // Genuine Samsung camera:
918
            // Require at least an IFD with 1 entry
919
            if (size < 18) return 0;
920
            return newSamsungMn2(tag, group, mnGroup);
921
        }
912 922
    }
913 923

  
914 924
    TiffComponent* newSamsungMn2(uint16_t tag,
(1-1/2)