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

HEIC to JPG image conversion #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cdraf
Copy link

@cdraf cdraf commented Apr 22, 2021

I was inspired by the Initial work towards HEIC to JPG conversion and thought I could contribute. What I came up with is similar but does not require ImageMagick.

The initial PR, and subsequent commit (since squashed), triggered a git workflow that showed build errors for python3.9. It seems that there is no wheel but one is coming.

Also the build machine needs libheif-dev installed to pass the check_quality and validate_build. I don't know if adding an additional package to the build/user machine falls in line with what this project wants but I think the build will pass if it is installed.

@menkej
Copy link
Collaborator

menkej commented Feb 6, 2022

Sorry for reacting so late, I'm really busy outside my open source dev work since a while (hope it will get better soon). Anyways:

Nice work! I could only have a quick look, so here are my initial thoughts: it adds another dependency to an external non python tool/lib, right? How do we make sure this still works on our currently supported platforms. There are users on Win/Mac and not only Linux relying on icloudpd. How could we handle this? It seems like you're sticking within docker at the moment. Have you tried other platforms?

@cdraf
Copy link
Author

cdraf commented Feb 13, 2022

No problem, I completely understand.

I will have to test it out on the other platforms (mac/win). It may be that the required lib is bundled with the Python package but I'm just guessing. Am hoping to get some time in the next few weeks to check it out and see if there is a reasonable solution.

@cdraf
Copy link
Author

cdraf commented Feb 23, 2023

get some time in the next few weeks

that did not happen lol

I've changed base.py to import heif_to_jpg only if the --convert-jpg argument is passed which makes the dependency on pyheif (and Pillow) optional, end users will only need the additional dependencies if they want to do image conversion.

To handle the Windows case I built and installed libheif using vcpkg and copied the libs and dlls to the venv which allows the pip install pyheif to succeed. I've added instructions to the README.

I don't have a mac so I am not able to confirm if any of this works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants