Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

Add option to re-unpack image or manually invalidate unpacked data if certain options are changed #73

Open
SamWhited opened this issue Jun 27, 2015 · 1 comment

Comments

@SamWhited
Copy link
Member

Options like rotation can affect data unpacking. This means that if we do:

with Raw(filename='somefile.raw') as raw:
    raw.save(filename='somefile.ppm')
    raw.options.rotation = 180
    raw.save(filename='somefile_rotated.ppm')

It won't work for some filetypes / cameras (because data is already unpacked and cached after the first unpack call).

We should either invalidate the unpacked data if one of these options is used and unpack again, or have an option to force unpacking on the unpack method and any method that calls it (eg. save).

A discussion should happen about how this is done.

@SamWhited
Copy link
Member Author

At the moment, it looks like we'd have to close / open the file each time it's saved. This would break the expectation in Python land of "the file is open as long as the context manager is in use".

@campaul I'm starting to think we should just document these options and let people handle the context managers / open / closing as they see fit if their camera requires it.

@SamWhited SamWhited added this to the v0.6.0 milestone Jul 17, 2015
@SamWhited SamWhited modified the milestones: v0.5.0, v0.6.0 Aug 14, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant