Skip to content

Integer overflow when setting coordinates with set_geo #28

@kpetrykin

Description

@kpetrykin

Hello! I have the following error while writing image with new coordinates which have been set by set_geo function:

File "/usr/local/lib/python2.7/dist-packages/pexif.py", line 520, in getdata
actual_data += pack(e + t, *the_data[i].as_tuple())
error: 'i' format requires -2147483648 <= number <= 2147483647

I debug the code a little and saw that if we have here

secs = long(secs * JpegFile.SEC_DEN)

seconds more than 42,94967294 we have such an error.
So, why do you need to multiply seconds to JpegFile.SEC_DEN = 50000000 at all?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions