Git Product home page Git Product logo

pyheif-pillow-opener's Introduction

pyheif-pillow-opener

Project Status: Moved build coverage Py Versions license status PEP8

pyheif-pillow-opener is a simple HEIF/HEIC opener for Pillow base on pyhief library.

Moved

This project is discontinued in favour of heif-image-plugin.

License

Released under MIT License.

pyheif-pillow-opener's People

Contributors

ciotto avatar homm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

pyheif-pillow-opener's Issues

sigal - pillow issue with this addon

Hi,

when running this with a single heic image with the static image generation (sigal) which uses pillow then i get:

INFO: Using 4 cores
DEBUG: Albums:
dict_values([(path='.', title='test')])
INFO: IMG_20210724_155951.jpg exists - skipping
Traceback (most recent call last):
File "/home/simon/py_sigal/./bin/sigal", line 8, in
sys.exit(main())
File "/home/simon/py_sigal/lib/python3.9/site-packages/click/core.py", line 1137, in call
return self.main(*args, **kwargs)
File "/home/simon/py_sigal/lib/python3.9/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/home/simon/py_sigal/lib/python3.9/site-packages/click/core.py", line 1668, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/simon/py_sigal/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/simon/py_sigal/lib/python3.9/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/home/simon/py_sigal/lib/python3.9/site-packages/sigal/init.py", line 157, in build
gal.build(force=force)
File "/home/simon/py_sigal/lib/python3.9/site-packages/sigal/gallery.py", line 756, in build
for status in self.pool.imap_unordered(worker, media_list):
File "/usr/lib/python3.9/multiprocessing/pool.py", line 870, in next
raise value
File "/usr/lib/python3.9/multiprocessing/pool.py", line 537, in _handle_tasks
put(task)
File "/usr/lib/python3.9/multiprocessing/connection.py", line 211, in send
self._send_bytes(_ForkingPickler.dumps(obj))
File "/usr/lib/python3.9/multiprocessing/reduction.py", line 51, in dumps
cls(buf, protocol).dump(obj)
TypeError: cannot pickle 'module' object
(py_sigal) simon@odroidh2:~/py_sigal$

Is this familiar ? Any tip ?

Issue with pip install

Good Day,

I'm getting the following when trying to install on Windows 10 with python 3.6 with library [email protected] and [email protected]

build\temp.win-amd64-3.6\Release\_libheif_cffi.c(570): fatal error C1083: Cannot open include file: 'libheif/heif.h': No such file or directory error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

Do I need to have another library installed before installing this one?

Performance

Hi,

Thanks for developing this extension to Pillow. I had a question regarding performance converting a .heic to a .jpg file. Running heif-convert is about twice as fast as doing:

import pillow_heif.HeifImagePlugin

img = Image.open(path_heic)
img.save(path_jpg)

Is this expected? For 100 images, heif-convert took 42 seconds, pillow_heif took 75 seconds (threaded), and 208 seconds using one thread.

Thanks,

Add information about current status

Hi, @ciotto!

I'm one of the Pillow developers and I created a fork of this plugin with many bug fixes. It called heif-image-plugin. Also I working on many changes in Pyheif and even some changes in libheif to ensure first-class HEIF images support in Pillow.

I understand that at one time pyheif-pillow-opener was necessary step and appreciate it. However since I don't see any activity in the repository I assume that there are no people who interested in further development (please, correct me if I wrong).

I propose to add a description that the project is not on actively developed and optionally add a link to heif-image-plugin.

With respect to your work, Alex.

size stays 0 when passing flask's FileStorage

Hello,

when passing a Flask's FileStorage as fp to the open method of Pillow's Image this plugin does not set the size property which results in image being rejected because of this check in ImageFile..

Given that _open in the plugin sets _size correctly, a little workaround I used in my code - is to just set size to _size and re-register open for heif with my wrapper. However it would be better to have it not require modification on my side.

PIL.UnidentifiedImageError on HEIF file despite pyheif-pillow-opener

I tried to use pyheif_pillow_opener, but can't get it to work.

>>> from PIL import Image
>>> from pyheif_pillow_opener import register_heif_opener
>>> register_heif_opener()
>>> img = Image.open(".../heif.heic")
...
PIL.UnidentifiedImageError: cannot identify image file

The test file is available here.
I'm using a Ubuntu 20.04 derivative, pyheif 0.5.1, libheif1 1.11.0, and libde265-0 1.0.8.

(Initially posted at python-pillow/Pillow#2806 (comment))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.