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

Fix of the Flash description for Flash == OFF #356

Merged
merged 1 commit into from
Oct 10, 2018

Conversation

Gorbush
Copy link

@Gorbush Gorbush commented Jul 30, 2018

For the case mentioned in #354
The case when the value is 0x10 - the description should say no Auto - as it is enforced to be OFF

@Gorbush Gorbush changed the title Fix of the Flash description for case when 0x10 - when flash is force… Fix of the Flash description for Flash == OFF Jul 30, 2018
@@ -844,7 +844,8 @@ public String getFlashDescription()
sb.append(", return not detected");
}

if ((value & 0x10) != 0)
// If 0x10 is set and the lowest byte is not zero - then flash is Auto
if ((value & 0x10) != 0 && (value & 0x0F) != 0)
sb.append(", auto");
Copy link
Owner

Choose a reason for hiding this comment

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

Do you have a reference for this change? (On phone right now.)

Copy link
Author

@Gorbush Gorbush Oct 9, 2018

Choose a reason for hiding this comment

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

The reference is here:
Hi,

sorry missed this email.
By reference did you mean why I think this change is right?

Here is the clarification:
com/drew/metadata/exif/ExifDirectoryBase.java:333
Basing on the description of this field

/**
 * 0x0  = 0000000 = No Flash
 * 0x1  = 0000001 = Fired
 * 0x5  = 0000101 = Fired, Return not detected
 * 0x7  = 0000111 = Fired, Return detected
 * 0x9  = 0001001 = On
 * 0xd  = 0001101 = On, Return not detected
 * 0xf  = 0001111 = On, Return detected
 * 0x10 = 0010000 = Off
 * 0x18 = 0011000 = Auto, Did not fire
 * 0x19 = 0011001 = Auto, Fired
 * 0x1d = 0011101 = Auto, Fired, Return not detected
 * 0x1f = 0011111 = Auto, Fired, Return detected
 * 0x20 = 0100000 = No flash function
 * 0x41 = 1000001 = Fired, Red-eye reduction
 * 0x45 = 1000101 = Fired, Red-eye reduction, Return not detected
 * 0x47 = 1000111 = Fired, Red-eye reduction, Return detected
 * 0x49 = 1001001 = On, Red-eye reduction
 * 0x4d = 1001101 = On, Red-eye reduction, Return not detected
 * 0x4f = 1001111 = On, Red-eye reduction, Return detected
 * 0x59 = 1011001 = Auto, Fired, Red-eye reduction
 * 0x5d = 1011101 = Auto, Fired, Red-eye reduction, Return not detected
 * 0x5f = 1011111 = Auto, Fired, Red-eye reduction, Return detected
 *        6543210 (positions)
 *
 * This is a bitmask.
 * 0 = flash fired
 * 1 = return detected
 * 2 = return able to be detected
 * 3 = unknown
 * 4 = auto used
 * 5 = unknown
 * 6 = red eye reduction used
 */

Auto is everywhere where bit is set 0x10 but requires that the lower 4 bits
are not zero:

 * 0x10 = 0010000 = Off

 * 0x18 = 0011000 = Auto, Did not fire
 * 0x19 = 0011001 = Auto, Fired
 * 0x1d = 0011101 = Auto, Fired, Return not detected
 * 0x1f = 0011111 = Auto, Fired, Return detected

 * 0x59 = 1011001 = Auto, Fired, Red-eye reduction
 * 0x5d = 1011101 = Auto, Fired, Red-eye reduction, Return not detected
 * 0x5f = 1011111 = Auto, Fired, Red-eye reduction, Return detected

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks for following up. This looks great.

@Gorbush
Copy link
Author

Gorbush commented Aug 3, 2018 via email

@drewnoakes drewnoakes merged commit 635aae2 into drewnoakes:master Oct 10, 2018
@drewnoakes
Copy link
Owner

Looks like we have the same issue in the .NET version, if you want to take a stab at it:

https://github.com/drewnoakes/metadata-extractor-dotnet/blob/master/MetadataExtractor/Formats/Exif/ExifDescriptorBase.cs#L940

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

Successfully merging this pull request may close these issues.

3 participants