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

XPTitle info tag can be an ASCII string #1

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open

XPTitle info tag can be an ASCII string #1

wants to merge 1 commit into from

Conversation

kstokoz
Copy link

@kstokoz kstokoz commented May 22, 2014

Feels like another windows hack, but I have an image created by Windows Lumia Phone which contains
XP Title encoded as ascii value, which somehow contradicts exif spec.

Unfortunately I cannot contribute an image to this repository for testing, but here is
EXIF before change:

    Root: 
        ImageDescription: 'Pyöräilykauden avaus ja samalla visiitti remontoituun talvipuutarhaan'
        Make: 'Nokia'
        Model: 'Nokia Lumia 800'
        Orientation: 1
        XResolution: 72
        YResolution: 72
        ResolutionUnit: 2
        Software: 'Windows Phone 7.5'
        Artist: ''
        YCbCrPositioning: 1
        Rating: 0
        RatingPercent: 0
        ExifOffset: 2394
        GPSInfo: 4718
        XPTitle: Invalid value: Text field not encoded as bytes.
        Padding: 28, -22, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... (2060)

    Exif: 
        ExposureTime: 1/1404 (0.001)
        FNumber: 22/10 (2.2)
        ExifVersion: 48, 50, 50, 48
        DateTimeOriginal: '2012:04:15 14:25:06'
        DateTimeDigitized: '2012:04:15 14:25:06'
        ComponentsConfiguration: 1, 2, 3, 0
        MeteringMode: 2
        Flash: 16
        FlashpixVersion: 48, 49, 48, 48
        ColorSpace: 1
        ExifImageWidth: 3264
        ExifImageLength: 2448
        ImageUniqueID: '3C15D8C63616CF3528F5AB6EC5C093F3'
        Padding: 28, -22, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... (2060)

    Gps: 
               ....

    Sub:  (jpegImageData)
        Compression: 6
        XResolution: 72
        YResolution: 72
        ResolutionUnit: 2
        JpgFromRawStart: 5064
        JpgFromRawLength: 18387

With following exception reading EXIF data:
org.apache.commons.imaging.ImageWriteException: Text field not encoded as bytes.
    at org.apache.commons.imaging.formats.tiff.TiffImageMetadata$Directory.getOutputDirectory(TiffImageMetadata.java:176)
    at org.apache.commons.imaging.formats.tiff.TiffImageMetadata.getOutputSet(TiffImageMetadata.java:229)

EXIF Info after change:

    Root: 
        ImageDescription: 'Pyöräilykauden avaus ja samalla visiitti remontoituun talvipuutarhaan'
        Make: 'Nokia'
        Model: 'Nokia Lumia 800'
        Orientation: 1
        XResolution: 72
        YResolution: 72
        ResolutionUnit: 2
        Software: 'Windows Phone 7.5'
        Artist: ''
        YCbCrPositioning: 1
        Rating: 0
        RatingPercent: 0
        ExifOffset: 2394
        GPSInfo: 4718
        XPTitle: 'Pyöräilykauden avaus ja samalla visiitti remontoituun talvipuutarhaan'
        Padding: 28, -22, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... (2060)

    Exif: 
        ExposureTime: 1/1404 (0.001)
        FNumber: 22/10 (2.2)
        ExifVersion: 48, 50, 50, 48
        DateTimeOriginal: '2012:04:15 14:25:06'
        DateTimeDigitized: '2012:04:15 14:25:06'
        ComponentsConfiguration: 1, 2, 3, 0
        MeteringMode: 2
        Flash: 16
        FlashpixVersion: 48, 49, 48, 48
        ColorSpace: 1
        ExifImageWidth: 3264
        ExifImageLength: 2448
        ImageUniqueID: '3C15D8C63616CF3528F5AB6EC5C093F3'
        Padding: 28, -22, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0... (2060)

    Gps: 
              ..

    Sub:  (jpegImageData)
        Compression: 6
        XResolution: 72
        YResolution: 72
        ResolutionUnit: 2
        JpgFromRawStart: 5064
        JpgFromRawLength: 18387

TiffOutputSet {
byteOrder: BIG_ENDIAN
    directory 0: Root (0)
        field 0: [TagInfo. tag: 270 (0x10e, name: ImageDescription]
        field 0: [TagInfo. tag: 271 (0x10f, name: Make]
        field 0: [TagInfo. tag: 272 (0x110, name: Model]
        field 0: [TagInfo. tag: 274 (0x112, name: Orientation]
        field 0: [TagInfo. tag: 282 (0x11a, name: XResolution]
        field 0: [TagInfo. tag: 283 (0x11b, name: YResolution]
        field 0: [TagInfo. tag: 296 (0x128, name: ResolutionUnit]
        field 0: [TagInfo. tag: 305 (0x131, name: Software]
        field 0: [TagInfo. tag: 315 (0x13b, name: Artist]
        field 0: [TagInfo. tag: 531 (0x213, name: YCbCrPositioning]
        field 0: [TagInfo. tag: 18246 (0x4746, name: Rating]
        field 0: [TagInfo. tag: 18249 (0x4749, name: RatingPercent]
        field 0: [TagInfo. tag: 40091 (0x9c9b, name: XPTitle]
        field 0: [TagInfo. tag: 59932 (0xea1c, name: Padding]
    directory 1: Exif (-2)
        field 1: [TagInfo. tag: 33434 (0x829a, name: ExposureTime]
        field 1: [TagInfo. tag: 33437 (0x829d, name: FNumber]
        field 1: [TagInfo. tag: 36864 (0x9000, name: ExifVersion]
        field 1: [TagInfo. tag: 36867 (0x9003, name: DateTimeOriginal]
        field 1: [TagInfo. tag: 36868 (0x9004, name: DateTimeDigitized]
        field 1: [TagInfo. tag: 37121 (0x9101, name: ComponentsConfiguration]
        field 1: [TagInfo. tag: 37383 (0x9207, name: MeteringMode]
        field 1: [TagInfo. tag: 37385 (0x9209, name: Flash]
        field 1: [TagInfo. tag: 40960 (0xa000, name: FlashpixVersion]
        field 1: [TagInfo. tag: 40961 (0xa001, name: ColorSpace]
        field 1: [TagInfo. tag: 40962 (0xa002, name: ExifImageWidth]
        field 1: [TagInfo. tag: 40963 (0xa003, name: ExifImageLength]
        field 1: [TagInfo. tag: 42016 (0xa420, name: ImageUniqueID]
        field 1: [TagInfo. tag: 59932 (0xea1c, name: Padding]
    directory 2: Gps (-3)
        field 2: [TagInfo. tag: 1 (0x1, name: GPSLatitudeRef]
        field 2: [TagInfo. tag: 2 (0x2, name: GPSLatitude]
        field 2: [TagInfo. tag: 3 (0x3, name: GPSLongitudeRef]
        field 2: [TagInfo. tag: 4 (0x4, name: GPSLongitude]
        field 2: [TagInfo. tag: 5 (0x5, name: GPSAltitudeRef]
        field 2: [TagInfo. tag: 6 (0x6, name: GPSAltitude]
        field 2: [TagInfo. tag: 10 (0xa, name: GPSMeasureMode]
        field 2: [TagInfo. tag: 11 (0xb, name: GPSDOP]
    directory 3: Sub (1)
        field 3: [TagInfo. tag: 259 (0x103, name: Compression]
        field 3: [TagInfo. tag: 282 (0x11a, name: XResolution]
        field 3: [TagInfo. tag: 283 (0x11b, name: YResolution]
        field 3: [TagInfo. tag: 296 (0x128, name: ResolutionUnit]
        field 3: [TagInfo. tag: 514 (0x202, name: JpgFromRawLength]
}

feels like another windows hack. I have an image created by Windows Lumia Phone which contains
XP Title encoded as ascii value, which somehow contradicts exif spec
kinow referenced this pull request in kinow/commons-imaging Dec 31, 2017
@kinow
Copy link
Member

kinow commented May 26, 2019

Hmm, this is tricky to review. All sources I'm finding about XPTitle (1 2 3) either do not specify the type, or use byte/int.

And if someone could provide a sample image, to be used for development and testing, that would be helpful too.

Copy link
Member

@kinow kinow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if this could be rebased to fix the git conflicts. Also necessary to have a JIRA issue and - preferably - an example image as attachment there.

@kinow kinow added the someday label Jul 5, 2021
asfgit pushed a commit that referenced this pull request Jun 2, 2023
(build passes for me locally on Windows 10 and Linux
5.10.16.3-microsoft-standard-WSL2 #1 SMP Fri Apr 2 22:23:49 UTC 2021
x86_64 x86_64 x86_64 GNU/Linux (within Windows WSL)
@garydgregory garydgregory changed the title XPTitle info tag can be a ascii string XPTitle info tag can be an ASCII string Dec 23, 2023
@garydgregory
Copy link
Member

Needs a test as well.

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

Successfully merging this pull request may close these issues.

3 participants