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

Error with InteropIFD : missing / corrupted after save #10

Closed
u1735067 opened this issue Nov 9, 2016 · 2 comments
Closed

Error with InteropIFD : missing / corrupted after save #10

u1735067 opened this issue Nov 9, 2016 · 2 comments

Comments

@u1735067
Copy link

u1735067 commented Nov 9, 2016

I have an issue with the sub IFD InteropIFD : when I load a jpg and save it, it is missing or shown as corrupt in exiftool after (with this example, it's corrupted). I guess it's not the expected behaviour.

Before :

Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100

after :

Warning                         : Bad InteropIFD directory

Steps :

jpg = Tyf.open('testori.jpg')
#Print some tags
for i in jpg.exif.tags():
    print(i)
# eventually, (re)write 3-4 tags
jpg.save('testinterop.jpg')

The source file might be corrupted, but it should be original from the smartphone.

Files :
testori
testinterop

Python 3.5.2 64bit Win

@Moustikitos
Copy link
Owner

Moustikitos commented Nov 10, 2016

Hi,

I did not implement interoperability subIFD.
working on it, release to follow... Stay tuned!

Thanks for using my lib.

@Moustikitos
Copy link
Owner

Hi,

I fixed the issue.

>>> jpg = Tyf.open("issue #7.jpg")
>>> jpg.save("issue.7.jpg")
>>> jpg = Tyf.open("issue.7.jpg")
>>> jpg.exif
{272: <Tiff tag 0x110: Model = b'blade'>, 531: <Tiff tag 0x213: YCbCrPositioning = (1,)> := 'Centered', 296: <Tiff tag 0x128: ResolutionUnit = (2,)> := 'Inch', 34665: <Tiff tag 0x8769: Exif IFD = (147,)>, 282: <Tiff tag 0x11a: XResolution = (72, 1)>, 283: <Tiff tag 0x11b: YResolution = (72, 1)>, 271: <Tiff tag 0x10f: Make = b'CyanogenMod\x00'>}
>>> jpg.exif["Exif IFD"]
{36864: <Exif tag 0x9000: ExifVersion = b'0220'>, 37121: <Exif tag 0x9101: ComponentsConfiguration = b'\x01\x02\x03\x00'>, 40962: <Exif tag 0xa002: PixelXDimension = (2048,)>, 36867: <Exif tag 0x9003: DateTimeOriginal = b'2012:01:19 16:13:28\x00'>, 36868: <Exif tag 0x9004: DateTimeDigitized = b'2012:01:19 16:13:28\x00'>, 40965: <Exif tag 0xa005: Interoperability IFD = (301,)>, 40960: <Exif tag 0xa000: FlashpixVersion = b'0100'>, 40961: <Exif tag 0xa001: ColorSpace = (1,)> := 'RGB', 40963: <Exif tag 0xa003: PixelYDimension = (1536,)>}
>>> jpg.exif["Exif IFD"]["Interoperability IFD"]
{1: <Interop tag 0x1: InteropIndex = b'R98\x00'> := 'R98 - DCF basic file (sRGB)', 2: <Interop tag 0x2: InteropVersion = b'0100'>}

Keep me updated.

Moustikitos pushed a commit that referenced this issue Nov 23, 2016
issue #10
Moustikitos pushed a commit that referenced this issue Nov 26, 2016
encoder/decoder bugfix
issue #10
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

2 participants