Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworked options() from 0.9.0 version #57

Closed
bigcat88 opened this issue Nov 26, 2022 · 0 comments
Closed

Reworked options() from 0.9.0 version #57

bigcat88 opened this issue Nov 26, 2022 · 0 comments
Labels
Important information Major release changes Stale

Comments

@bigcat88
Copy link
Owner

bigcat88 commented Nov 26, 2022

As we come closer to 1.0.0 version we need more consistent API for setting options.
Was looking how it is done in Pillow and liked it.

Current code:

pillow_heif.options().thumbnails = False

in new version will be changed to:

pillow_heif.options.THUMBNAILS= False

Usage when it is used a plugin will not be changed, old code will work the same way:

from pillow_heif import register_heif_opener
register_heif_opener(thumbnails=False)

It will require less code from me to support, will not break API for plugin use, and such code will be a bit faster.

Changes for code when use it not as a plugin:
pillow_heif.options().thumbnails=False -> pillow_heif.options.THUMBNAILS=False
pillow_heif.options().quality=100 -> pillow_heif.options.QUALITY=100
pillow_heif.options().save_to_12bit=True -> pillow_heif.options.SAVE_HDR_TO_12BIT=True

New IMPORTANT options (list will be updated as I currently working on this):

DECODE_THREADS=4
Option to set number of decode threads(when it is possible). Benchmarks will be posted after update released.
Usage of option for register_heif_opener :

register_heif_opener(decode_threads=10)

or

pillow_heif.options.DECODE_THREADS= 10
@bigcat88 bigcat88 added the Important information Major release changes label Nov 26, 2022
@bigcat88 bigcat88 added the Stale label Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Important information Major release changes Stale
Projects
None yet
Development

No branches or pull requests

1 participant