Skip to content

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

Merged
drewnoakes merged 1 commit into
drewnoakes:masterfrom
Gorbush:FlashAutoDescription
Oct 10, 2018
Merged

Fix of the Flash description for Flash == OFF#356
drewnoakes merged 1 commit into
drewnoakes:masterfrom
Gorbush:FlashAutoDescription

Conversation

@Gorbush

@Gorbush Gorbush commented Jul 30, 2018

Copy link
Copy Markdown

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
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
Copy Markdown
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.)

@Gorbush Gorbush Oct 9, 2018

Copy link
Copy Markdown
Author

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
Copy Markdown
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

Gorbush commented Aug 3, 2018 via email

Copy link
Copy Markdown
Author

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

Copy link
Copy Markdown
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