Open iqbalaydrus opened 4 years ago
using a little hack like this works though:
manager = PreviewManager(temp_path)
manager._factory._builder_classes['image/heic'] = manager._factory.get_builder_class('image/jpeg')
get_jpeg_preview
method works well with the hack above
Hi @iqbalaydrus,
Thanks for your feedback and the hack which will help fixing the issue. @inkhey do you know why the image/heic
mimetype is not supported without this hack?
@iqbalaydrus do you have an example file to give us? This would allow to test the fix we'll implement and would allow us to add a non-regression test (which make sure the image format will still be supported in the future)
Thanks a lot.
@iqbalaydrus Hello ! Which version of preview_generator are you using ? Support for HEIC is new and there was no preview_generator pypi release since.
@inkhey the problem is pypi shows the develop
version of supported mimetypes while they are not all in the last release.
In the past, the supported mimetype list was generated for pypi publication...
I suggest two things:
This will allow users to understand why a mimetype is (or is not) supported
@iqbalaydrus do you have an example file to give us? This would allow to test the fix we'll implement and would allow us to add a non-regression test (which make sure the image format will still be supported in the future)
Sure, this is a random photo I took, zipped it since github don't support HEIC upload (ouch) IMG_0691.HEIC.zip
@iqbalaydrus Hello ! Which version of preview_generator are you using ? Support for HEIC is new and there was no preview_generator pypi release since.
I installed the latest version (0.13) via pip. Ah ok, that explains why I don't have heic support. I guess I'll use the hack until the next release.
I'm using a python docker image based on debian, also tried official python3.8 image without success with HEIC image. Below is the relevant dockerfile:
Running get_jpeg_preview method gave me this error:
Also this is my
--check-dependencies
output:According to this supported_mimetypes it should be supported, but it gave me that error.