bigcat88/pillow_heif

pillow-heif doubling filesize during PyInstaller Build

ktzug opened this issue ยท 6 comments

ktzug commented

Describe the bug

My sv-dlp project started using pillow-heif (0.5.1) on its latest version (2022.07.30). Turns out compiling it with pillow-heif on a (GitHub Actions) Linux environment doubles the size from 26.6MB to 43.7MB.
I tried using UPX, installing the required system modules that (libaom, libde265, libx265), but it was still doubling the size for whatever reason.

Weird thing is, Windows (19.8MB -> 24.7MB) and MacOS (23.4MB -> 31.6MB) builds don't seem seriously affected by this, but still rises.

Below I'll leave a sample of my build script, requirements file, and the build results comparison using a WSL Arch environment

Steps/Code to Reproduce

I honestly don't know what to put here so I'll just put my build.py script

import PyInstaller.__main__
import platform

SYS_OS = platform.system()
SYS_ARCH = platform.architecture()[0][:2]
suffix = f"{'_macos' if SYS_OS == 'Darwin' else ''}{'_x86' if SYS_ARCH == '32' else ''}{'.exe' if SYS_OS == 'Windows' else ''}"

def main():
    opts = [
        'sv-dlp/__main__.py',
        '--onefile',
        f'--name=sv-dlp{suffix}'
    ]

    print(f"Building sv-dlp for platform {SYS_OS} with architecture {SYS_ARCH}")
    PyInstaller.__main__.run(opts)

if __name__ == '__main__':
    main()
altgraph==0.17.2
certifi==2022.6.15
charset-normalizer==2.1.0
colorama==0.4.5
future==0.18.2
idna==3.3
pefile==2021.9.3
Pillow==9.2.0
pillow-heif==0.5.1
pyinstaller==4.10
pyinstaller-hooks-contrib==2022.3
pylance==0.0.1
pyproj==3.3.1
pywin32-ctypes==0.2.0
requests==2.28.1
tqdm==4.64.0
urllib3==1.26.11
protobuf==4.21.4
pycryptodome==3.15.0
sudo apt-get install libaom0 libde265-0 libx265-179 # ubuntu
sudo pacman -S aom libde265 x265 # arch

Expected Results

Before installing pillow-heif

Building sv-dlp for platform Linux with architecture 64
84 INFO: PyInstaller: 4.10
84 INFO: Python: 3.10.5
85 INFO: Platform: Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.35
87 INFO: wrote /mnt/f/code/sv-dlp/sv-dlp.spec
89 INFO: UPX is available.
96 INFO: Extending PYTHONPATH with paths
['/mnt/f/code/sv-dlp/sv-dlp']
270 INFO: checking Analysis
271 INFO: Building Analysis because Analysis-00.toc is non existent
271 INFO: Initializing module dependency graph...
275 INFO: Caching module graph hooks...
279 INFO: Analyzing base_library.zip ...
3053 INFO: Caching module dependency graph...
3189 INFO: running Analysis Analysis-00.toc
3204 INFO: Analyzing /mnt/f/code/sv-dlp/sv-dlp/__main__.py
3271 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-urllib3.packages.six.moves.py'.
5354 INFO: Processing pre-find module path hook distutils from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
5371 INFO: distutils: retargeting to non-venv dir '/usr/lib/python3.10'
5776 INFO: Processing pre-safe import module hook win32com from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'.
6751 INFO: Processing pre-find module path hook site from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/pre_find_module_path/hook-site.py'.
6752 INFO: site: retargeting to fake-dir '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/fake-modules'
7233 INFO: Processing module hooks...
7233 INFO: Loading module hook 'hook-pyproj.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7239 INFO: Loading module hook 'hook-appdirs.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7240 INFO: Loading module hook 'hook-cryptography.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7398 INFO: Loading module hook 'hook-pycparser.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7398 INFO: Loading module hook 'hook-Crypto.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7401 INFO: Loading module hook 'hook-certifi.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7402 INFO: Loading module hook 'hook-jaraco.text.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7403 INFO: Loading module hook 'hook-heapq.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7404 INFO: Loading module hook 'hook-pickle.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7405 INFO: Loading module hook 'hook-distutils.util.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7406 INFO: Loading module hook 'hook-setuptools.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7424 INFO: Loading module hook 'hook-distutils.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7432 INFO: Loading module hook 'hook-multiprocessing.util.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7433 INFO: Loading module hook 'hook-lib2to3.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7444 INFO: Loading module hook 'hook-xml.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7476 INFO: Loading module hook 'hook-difflib.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7477 INFO: Loading module hook 'hook-packaging.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7477 INFO: Loading module hook 'hook-PIL.Image.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7743 INFO: Loading module hook 'hook-PIL.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7750 INFO: Loading module hook 'hook-encodings.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7803 INFO: Loading module hook 'hook-pkg_resources.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7851 WARNING: Hidden import "pkg_resources.py2_warn" not found!
7852 WARNING: Hidden import "pkg_resources.markers" not found!
7852 WARNING: Hidden import "pkg_resources._vendor.jaraco.functools" not found!
7852 WARNING: Hidden import "pkg_resources._vendor.jaraco.context" not found!
7852 WARNING: Hidden import "pkg_resources._vendor.jaraco.text" not found!
7853 INFO: Loading module hook 'hook-sysconfig.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7853 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7854 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7856 INFO: Loading module hook 'hook-setuptools.msvc.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7856 INFO: Loading module hook 'hook-_tkinter.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.10/tkinter/__init__.py", line 37, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
7903 ERROR: Tcl/Tk improperly installed on this system.
7916 INFO: Looking for ctypes DLLs
7936 INFO: Analyzing run-time hooks ...
7940 INFO: Including run-time hook '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_subprocess.py'
7941 INFO: Including run-time hook '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py'
7943 INFO: Including run-time hook '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py'
7945 INFO: Including run-time hook '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py'
7945 INFO: Including run-time hook '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgres.py'
7948 INFO: Including run-time hook '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_pyproj.py'
7955 INFO: Looking for dynamic libraries
8238 WARNING: Cannot find libmpdec.so.3 (needed by /usr/lib/python3.10/lib-dynload/_decimal.cpython-310-x86_64-linux-gnu.so)
8477 WARNING: Cannot find libwebp-a2d91712.so.7.1.3 (needed by /home/juan/.local/lib/python3.10/site-packages/PIL/../Pillow.libs/libwebpdemux-df590b8f.so.2.0.9)
8481 WARNING: Cannot find libwebp-a2d91712.so.7.1.3 (needed by /home/juan/.local/lib/python3.10/site-packages/PIL/../Pillow.libs/libwebpmux-625e1d4a.so.3.0.8)
8494 WARNING: Cannot find libXau-154567c4.so.6.0.0 (needed by /home/juan/.local/lib/python3.10/site-packages/PIL/../Pillow.libs/libxcb-4971137c.so.1.1.0)
8512 WARNING: Cannot find liblzma-96284f0d.so.5.2.5 (needed by /home/juan/.local/lib/python3.10/site-packages/PIL/../Pillow.libs/libtiff-f706b4a5.so.5.8.0)
8512 WARNING: Cannot find libjpeg-a4c3d5e9.so.62.3.0 (needed by /home/juan/.local/lib/python3.10/site-packages/PIL/../Pillow.libs/libtiff-f706b4a5.so.5.8.0)
ldd: warning: you do not have execution permission for `/usr/lib/libgcc_s.so.1'
8529 WARNING: Cannot find libsqlite3-e6e8c34c.so.0.8.6 (needed by /home/juan/.local/lib/python3.10/site-packages/pyproj/../pyproj.libs/libproj-3a67288e.so.22.2.0)
8529 WARNING: Cannot find libtiff-40073f1f.so.5.7.0 (needed by /home/juan/.local/lib/python3.10/site-packages/pyproj/../pyproj.libs/libproj-3a67288e.so.22.2.0)
8529 WARNING: Cannot find libcurl-c54b2682.so.4.7.0 (needed by /home/juan/.local/lib/python3.10/site-packages/pyproj/../pyproj.libs/libproj-3a67288e.so.22.2.0)
8538 WARNING: Cannot find libnghttp2-62f02794.so.14.20.1 (needed by /home/juan/.local/lib/python3.10/site-packages/pyproj/../pyproj.libs/libcurl-c54b2682.so.4.7.0)
8542 INFO: Looking for eggs
8542 INFO: Using Python library /usr/lib/libpython3.10.so.1.0
8548 INFO: Warnings written to /mnt/f/code/sv-dlp/build/sv-dlp/warn-sv-dlp.txt
8608 INFO: Graph cross-reference written to /mnt/f/code/sv-dlp/build/sv-dlp/xref-sv-dlp.html
8634 INFO: checking PYZ
8635 INFO: Building PYZ because PYZ-00.toc is non existent
8635 INFO: Building PYZ (ZlibArchive) /mnt/f/code/sv-dlp/build/sv-dlp/PYZ-00.pyz
9235 INFO: Building PYZ (ZlibArchive) /mnt/f/code/sv-dlp/build/sv-dlp/PYZ-00.pyz completed successfully.
9247 INFO: checking PKG
9248 INFO: Building PKG because PKG-00.toc is non existent
9248 INFO: Building PKG (CArchive) sv-dlp.pkg
19969 INFO: Building PKG (CArchive) sv-dlp.pkg completed successfully.
19975 INFO: Bootloader /home/juan/.local/lib/python3.10/site-packages/PyInstaller/bootloader/Linux-64bit-intel/run
19975 INFO: checking EXE
19976 INFO: Building EXE because EXE-00.toc is non existent
19976 INFO: Building EXE from EXE-00.toc
19977 INFO: Copying bootloader EXE to /mnt/f/code/sv-dlp/dist/sv-dlp
19980 INFO: Appending PKG archive to custom ELF section in EXE
21227 INFO: Building EXE from EXE-00.toc completed successfully.

Actual Results

After installing pillow-heif

Building sv-dlp for platform Linux with architecture 64
84 INFO: PyInstaller: 4.10
84 INFO: Python: 3.10.5
84 INFO: Platform: Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.35
86 INFO: wrote /mnt/f/code/sv-dlp/sv-dlp.spec
88 INFO: UPX is available.
95 INFO: Extending PYTHONPATH with paths
['/mnt/f/code/sv-dlp/sv-dlp']
260 INFO: checking Analysis
261 INFO: Building Analysis because Analysis-00.toc is non existent
261 INFO: Initializing module dependency graph...
264 INFO: Caching module graph hooks...
269 INFO: Analyzing base_library.zip ...
2932 INFO: Caching module dependency graph...
3073 INFO: running Analysis Analysis-00.toc
3086 INFO: Analyzing /mnt/f/code/sv-dlp/sv-dlp/__main__.py
3154 INFO: Processing pre-safe import module hook urllib3.packages.six.moves from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/pre_safe_import_module/hook-urllib3.packages.six.moves.py'.
5214 INFO: Processing pre-find module path hook distutils from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/pre_find_module_path/hook-distutils.py'.
5231 INFO: distutils: retargeting to non-venv dir '/usr/lib/python3.10'
5628 INFO: Processing pre-safe import module hook win32com from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/pre_safe_import_module/hook-win32com.py'.
6645 INFO: Processing pre-find module path hook site from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/pre_find_module_path/hook-site.py'.
6645 INFO: site: retargeting to fake-dir '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/fake-modules'
7126 INFO: Processing module hooks...
7126 INFO: Loading module hook 'hook-pyproj.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7131 INFO: Loading module hook 'hook-appdirs.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7132 INFO: Loading module hook 'hook-cryptography.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7292 INFO: Loading module hook 'hook-pycparser.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7292 INFO: Loading module hook 'hook-Crypto.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7295 INFO: Loading module hook 'hook-certifi.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7296 INFO: Loading module hook 'hook-jaraco.text.py' from '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
7297 INFO: Loading module hook 'hook-heapq.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7298 INFO: Loading module hook 'hook-pickle.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7299 INFO: Loading module hook 'hook-distutils.util.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7300 INFO: Loading module hook 'hook-setuptools.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7318 INFO: Loading module hook 'hook-distutils.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7326 INFO: Loading module hook 'hook-multiprocessing.util.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7327 INFO: Loading module hook 'hook-lib2to3.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7337 INFO: Loading module hook 'hook-xml.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7369 INFO: Loading module hook 'hook-difflib.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7371 INFO: Loading module hook 'hook-packaging.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7371 INFO: Loading module hook 'hook-PIL.Image.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7643 INFO: Loading module hook 'hook-PIL.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7650 INFO: Loading module hook 'hook-encodings.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7703 INFO: Loading module hook 'hook-pkg_resources.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7752 WARNING: Hidden import "pkg_resources.py2_warn" not found!
7752 WARNING: Hidden import "pkg_resources.markers" not found!
7752 WARNING: Hidden import "pkg_resources._vendor.jaraco.functools" not found!
7752 WARNING: Hidden import "pkg_resources._vendor.jaraco.context" not found!
7752 WARNING: Hidden import "pkg_resources._vendor.jaraco.text" not found!
7754 INFO: Loading module hook 'hook-sysconfig.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7754 INFO: Loading module hook 'hook-PIL.ImageFilter.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7755 INFO: Loading module hook 'hook-PIL.SpiderImagePlugin.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7756 INFO: Loading module hook 'hook-setuptools.msvc.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
7757 INFO: Loading module hook 'hook-_tkinter.py' from '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks'...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.10/tkinter/__init__.py", line 37, in <module>
    import _tkinter # If this fails your Python may not be configured for Tk
ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: libtk8.6.so: cannot open shared object file: No such file or directory
7802 ERROR: Tcl/Tk improperly installed on this system.
7815 INFO: Looking for ctypes DLLs
7835 INFO: Analyzing run-time hooks ...
7838 INFO: Including run-time hook '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_subprocess.py'
7839 INFO: Including run-time hook '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgutil.py'
7842 INFO: Including run-time hook '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_multiprocessing.py'
7843 INFO: Including run-time hook '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_inspect.py'
7844 INFO: Including run-time hook '/home/juan/.local/lib/python3.10/site-packages/PyInstaller/hooks/rthooks/pyi_rth_pkgres.py'
7846 INFO: Including run-time hook '/home/juan/.local/lib/python3.10/site-packages/_pyinstaller_hooks_contrib/hooks/rthooks/pyi_rth_pyproj.py'
7853 INFO: Looking for dynamic libraries
8096 WARNING: Cannot find libmpdec.so.3 (needed by /usr/lib/python3.10/lib-dynload/_decimal.cpython-310-x86_64-linux-gnu.so)
ldd: warning: you do not have execution permission for `/usr/lib/libgcc_s.so.1'
8345 WARNING: Cannot find libaom-0a65f09e.so.3.4.0 (needed by /home/juan/.local/lib/python3.10/site-packages/pillow_heif.libs/libheif-308f5ff2.so.1.12.0)
8345 WARNING: Cannot find libde265-f493bf68.so.0.1.1 (needed by /home/juan/.local/lib/python3.10/site-packages/pillow_heif.libs/libheif-308f5ff2.so.1.12.0)
8345 WARNING: Cannot find libx265-a25050ad.so.204 (needed by /home/juan/.local/lib/python3.10/site-packages/pillow_heif.libs/libheif-308f5ff2.so.1.12.0)
8370 WARNING: Cannot find libwebp-a2d91712.so.7.1.3 (needed by /home/juan/.local/lib/python3.10/site-packages/PIL/../Pillow.libs/libwebpmux-625e1d4a.so.3.0.8)
8374 WARNING: Cannot find libwebp-a2d91712.so.7.1.3 (needed by /home/juan/.local/lib/python3.10/site-packages/PIL/../Pillow.libs/libwebpdemux-df590b8f.so.2.0.9)
8383 WARNING: Cannot find liblzma-96284f0d.so.5.2.5 (needed by /home/juan/.local/lib/python3.10/site-packages/PIL/../Pillow.libs/libtiff-f706b4a5.so.5.8.0)
8383 WARNING: Cannot find libjpeg-a4c3d5e9.so.62.3.0 (needed by /home/juan/.local/lib/python3.10/site-packages/PIL/../Pillow.libs/libtiff-f706b4a5.so.5.8.0)
8387 WARNING: Cannot find libXau-154567c4.so.6.0.0 (needed by /home/juan/.local/lib/python3.10/site-packages/PIL/../Pillow.libs/libxcb-4971137c.so.1.1.0)
8405 WARNING: Cannot find libsqlite3-e6e8c34c.so.0.8.6 (needed by /home/juan/.local/lib/python3.10/site-packages/pyproj/../pyproj.libs/libproj-3a67288e.so.22.2.0)
8405 WARNING: Cannot find libtiff-40073f1f.so.5.7.0 (needed by /home/juan/.local/lib/python3.10/site-packages/pyproj/../pyproj.libs/libproj-3a67288e.so.22.2.0)
8405 WARNING: Cannot find libcurl-c54b2682.so.4.7.0 (needed by /home/juan/.local/lib/python3.10/site-packages/pyproj/../pyproj.libs/libproj-3a67288e.so.22.2.0)
8410 WARNING: Cannot find libnghttp2-62f02794.so.14.20.1 (needed by /home/juan/.local/lib/python3.10/site-packages/pyproj/../pyproj.libs/libcurl-c54b2682.so.4.7.0)
8422 INFO: Looking for eggs
8422 INFO: Using Python library /usr/lib/libpython3.10.so.1.0
8428 INFO: Warnings written to /mnt/f/code/sv-dlp/build/sv-dlp/warn-sv-dlp.txt
8486 INFO: Graph cross-reference written to /mnt/f/code/sv-dlp/build/sv-dlp/xref-sv-dlp.html
8517 INFO: checking PYZ
8517 INFO: Building PYZ because PYZ-00.toc is non existent
8517 INFO: Building PYZ (ZlibArchive) /mnt/f/code/sv-dlp/build/sv-dlp/PYZ-00.pyz
9134 INFO: Building PYZ (ZlibArchive) /mnt/f/code/sv-dlp/build/sv-dlp/PYZ-00.pyz completed successfully.
9148 INFO: checking PKG
9149 INFO: Building PKG because PKG-00.toc is non existent
9149 INFO: Building PKG (CArchive) sv-dlp.pkg
25747 INFO: Building PKG (CArchive) sv-dlp.pkg completed successfully.
25753 INFO: Bootloader /home/juan/.local/lib/python3.10/site-packages/PyInstaller/bootloader/Linux-64bit-intel/run
25753 INFO: checking EXE
25754 INFO: Building EXE because EXE-00.toc is non existent
25754 INFO: Building EXE from EXE-00.toc
25755 INFO: Copying bootloader EXE to /mnt/f/code/sv-dlp/dist/sv-dlp
25758 INFO: Appending PKG archive to custom ELF section in EXE
27499 INFO: Building EXE from EXE-00.toc completed successfully.

Versions

3.10.5 (main, Jun  6 2022, 18:49:26) [GCC 12.1.0]
Linux-5.10.16.3-microsoft-standard-WSL2-x86_64-with-glibc2.35
0.5.1
{'version': {'libheif': '1.12.0', 'x265': 'x265 HEVC encoder (3.5+1-f0c1022b6)', 'aom': 'AOMedia Project AV1 Encoder v3.4.0'}, 'decoders': {'HEVC': 1, 'AV1': 1, 'AVC': 0}, 'encoders': {'HEVC': 1, 'AV1': 1, 'AVC': 0}}

Weird thing is, Windows (19.8MB -> 24.7MB) and MacOS (23.4MB -> 31.6MB) builds don't seem seriously affected by this, but still rises.

Version 0.5.0 wheels sizes:
Windows: 7.7 MB
macOS: 6.6 MB
Linux: 13.2 MB

Version 0.5.1 wheels sizes:
Window: 7.8 MB
macOS: 6.7 MB
Linux: 15.0 MB

0.5.1 version is bigger for Linux due to compiling with AVIF encoder, it is a prerelease version for 0.6.0 that will come with .avif files support. Size of pillow-heif wheels will not grow from now, same wheels sizes will be for next version.

For Linux it need some investigation, why C libraries are so big(there is no so much code in libheif to be 13 MB in size when unpacked)

About this:
sudo apt-get install libaom0 libde265-0 libx265-179

I am thinking about rewriting how it builds from sources, currently it only looks for aom library and all other installed libraries are ignored(affects Linux only)

And maybe I do not understand issue, so need a bit more explanation in what trouble is.

  1. Big wheels size for Linux?
  2. Missing ability to build from source with custom x265 encoder and libde265(Again for Linux)?

@juanpisuribe13 was trying to build libheif and libde265 with cmake on manylinux that was ok and has less size, but on muslilinux it fails with segmentation fault error and I do not want to maintain two build types.
if you need i can add in a few days a github action file, that will produce wheels for linux without x265 and aom encoders libs and save it in artifacts, so you can fork repo and press one button and there will be produced wheels for linux with less size(~8mb).

For custom build from source I do not know, first I need rewrite building from source for Linux in some way it did not require administrative rights, after release of 0.6 version maybe if I will have enough will and time...

ktzug commented

@juanpisuribe13 was trying to build libheif and libde265 with cmake on manylinux that was ok and has less size, but on muslilinux it fails with segmentation fault error and I do not want to maintain two build types. if you need i can add in a few days a github action file, that will produce wheels for linux without x265 and aom encoders libs and save it in artifacts, so you can fork repo and press one button and there will be produced wheels for linux with less size(~8mb).

For custom build from source I do not know, first I need rewrite building from source for Linux in some way it did not require administrative rights, after release of 0.6 version maybe if I will have enough will and time...

Thank you so much. I definitely appreciate it if you do

Building libheif and libde265 with cmake was successful, if nothing will go wrong during testing, it will be included in 0.6.0 release and size of Linux wheels will decrease almost in 2x.
I think that it is what you was asking for. :)

ktzug commented

Thank you so much!

Release date: probably tomorrow.
Please give a star to this repository, if you will get satisfied after release.

Just to note: Build Light Version GitHub action builds a very small wheels for Linux.

And after release, if all is fine and you are fine with new release don't forget to close this issue.

GL & HF :)