pillow-avif-plugin 1.4.2__tar.gz → 1.4.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pillow-avif-plugin
3
- Version: 1.4.2
3
+ Version: 1.4.3
4
4
  Summary: A pillow plugin that adds avif support via libavif
5
5
  Home-page: https://github.com/fdintino/pillow-avif-plugin/
6
6
  Author: Frankie Dintino
@@ -28,6 +28,19 @@ def readme():
28
28
  IS_DEBUG = hasattr(sys, "gettotalrefcount")
29
29
  PLATFORM_MINGW = os.name == "nt" and "GCC" in sys.version
30
30
 
31
+ libraries = ["avif"]
32
+ if sys.platform == "win32":
33
+ libraries.extend(
34
+ [
35
+ "advapi32",
36
+ "bcrypt",
37
+ "ntdll",
38
+ "userenv",
39
+ "ws2_32",
40
+ "kernel32",
41
+ ]
42
+ )
43
+
31
44
  setup(
32
45
  name="pillow-avif-plugin",
33
46
  description="A pillow plugin that adds avif support via libavif",
@@ -39,7 +52,7 @@ setup(
39
52
  "pillow_avif._avif",
40
53
  ["src/pillow_avif/_avif.c"],
41
54
  depends=["avif/avif.h"],
42
- libraries=["avif"],
55
+ libraries=libraries,
43
56
  ),
44
57
  ],
45
58
  package_data={"": ["README.rst"]},
@@ -2,4 +2,4 @@ from . import AvifImagePlugin
2
2
 
3
3
 
4
4
  __all__ = ["AvifImagePlugin"]
5
- __version__ = "1.4.2"
5
+ __version__ = "1.4.3"
@@ -448,7 +448,11 @@ AvifEncoderNew(PyObject *self_, PyObject *args) {
448
448
  init_max_threads();
449
449
  }
450
450
 
451
- encoder->maxThreads = max_threads;
451
+ int is_aom_encode = strcmp(codec, "aom") == 0 ||
452
+ (strcmp(codec, "auto") == 0 &&
453
+ _codec_available("aom", AVIF_CODEC_FLAG_CAN_ENCODE));
454
+
455
+ encoder->maxThreads = is_aom_encode && max_threads > 64 ? 64 : max_threads;
452
456
  #if AVIF_VERSION >= 1000000
453
457
  if (enc_options.qmin != -1 && enc_options.qmax != -1) {
454
458
  encoder->minQuantizer = enc_options.qmin;
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pillow-avif-plugin
3
- Version: 1.4.2
3
+ Version: 1.4.3
4
4
  Summary: A pillow plugin that adds avif support via libavif
5
5
  Home-page: https://github.com/fdintino/pillow-avif-plugin/
6
6
  Author: Frankie Dintino