Fix of the Flash description for Flash == OFF - #356
Merged
Conversation
drewnoakes
reviewed
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"); |
Owner
There was a problem hiding this comment.
Do you have a reference for this change? (On phone right now.)
Author
There was a problem hiding this comment.
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
Owner
There was a problem hiding this comment.
Thanks for following up. This looks great.
Author
|
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
…On Mon, Jul 30, 2018 at 2:52 PM, Drew Noakes ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In Source/com/drew/metadata/exif/ExifDescriptorBase.java
<#356 (comment)>
:
> @@ -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");
Do you have a reference for this change? (On phone right now.)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#356 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAsM97K27TQuEoUrr-qUtDo_plZtkZ84ks5uL4AGgaJpZM4VnDit>
.
|
Owner
|
Looks like we have the same issue in the .NET version, if you want to take a stab at it: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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