Opened 12 years ago
Closed 12 years ago
#22259 closed defect (bug) (fixed)
Round image EXIF float data.
Reported by: | jcakec | Owned by: | nacin |
---|---|---|---|
Milestone: | 3.5 | Priority: | normal |
Severity: | normal | Version: | 3.5 |
Component: | Media | Keywords: | has-patch |
Focuses: | Cc: |
Description
Hello,
On changeset 21292 you made some changes to stripslashes as follows: Only run stripslashes() in stripslashes_deep() for strings.
Prior to these changes, when you called wp_read_image_metadata() all values were saved as strings. Now they are saves as the correct type, but as floats are approximations, instead of getting values like 0.0004 we are getting values of 0.0004000000000000000191686944095437183932517655193805694580078125
These values are making some galleries to misbehave with EXIF data, so could we round the values so we don't get these huge numbers, and that way we can still use the current plugins and widgets while the owners update them.
Attachments (2)
Change History (6)
#1
@
12 years ago
- Component changed from General to Media
- Milestone changed from Awaiting Review to 3.5
- Version set to trunk
#3
in reply to:
↑ 2
@
12 years ago
Replying to nacin:
We also round aperture already, so this makes sense. But is 4 the maximum number of decimal places we'd ever have here? To keep existing behavior, simply casting to a string should be sufficient, right?
Well, according to http://en.wikipedia.org/wiki/Shutter_speed the maximum speed can be 1/16000 s, so that's 0.0000625, so 7 seems to be better value than 4, but most of the images I've seen during my tests had 0.0004 as the lowest value.
casting everything to string would be sufficient? yes it would be, but would that be the better approach? I left that question to you guys, as you're the experts. :)
We also round aperture already, so this makes sense. But is 4 the maximum number of decimal places we'd ever have here? To keep existing behavior, simply casting to a string should be sufficient, right?