first commit
This commit is contained in:
BIN
Heif2JPG.png
Normal file
BIN
Heif2JPG.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.3 MiB |
BIN
Heif2Jpg.ico
Normal file
BIN
Heif2Jpg.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 53 KiB |
4
Png2Ico.py
Normal file
4
Png2Ico.py
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
from PIL import Image
|
||||||
|
|
||||||
|
img = Image.open(r"C:\Users\vanko\MyCode\Heif2Jpg\Heif2JPG.png")
|
||||||
|
img.save(r"C:\Users\vanko\MyCode\Heif2Jpg\Heif2Jpg.ico", format='ICO', sizes=[(256, 256)])
|
||||||
20
build.bat
Normal file
20
build.bat
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
@echo off
|
||||||
|
echo Building HEIF to JPG converter...
|
||||||
|
|
||||||
|
:: Set actual paths based on your system
|
||||||
|
SET PYTHON_DLL_PATH=C:\Users\vanko\anaconda3\DLLs
|
||||||
|
SET VENV_PATH=C:\Users\vanko\MyCode\Heif2Jpg\heif2jpg
|
||||||
|
SET SITE_PACKAGES=%VENV_PATH%\Lib\site-packages
|
||||||
|
|
||||||
|
pyinstaller --noconsole --onefile ^
|
||||||
|
--icon="Heif2Jpg.ico" ^
|
||||||
|
--hidden-import=PIL._tkinter_finder ^
|
||||||
|
--hidden-import=xml.parsers.expat ^
|
||||||
|
--add-binary="%PYTHON_DLL_PATH%\pyexpat.pyd;." ^
|
||||||
|
--add-binary="%PYTHON_DLL_PATH%\_tkinter.pyd;." ^
|
||||||
|
--collect-all pillow_heif ^
|
||||||
|
--collect-all PIL ^
|
||||||
|
heif2jpgGuiBar.py
|
||||||
|
|
||||||
|
echo Done!
|
||||||
|
pause
|
||||||
4628
build/heif2jpgGuiBar/Analysis-00.toc
Normal file
4628
build/heif2jpgGuiBar/Analysis-00.toc
Normal file
File diff suppressed because it is too large
Load Diff
3141
build/heif2jpgGuiBar/EXE-00.toc
Normal file
3141
build/heif2jpgGuiBar/EXE-00.toc
Normal file
File diff suppressed because it is too large
Load Diff
3119
build/heif2jpgGuiBar/PKG-00.toc
Normal file
3119
build/heif2jpgGuiBar/PKG-00.toc
Normal file
File diff suppressed because it is too large
Load Diff
BIN
build/heif2jpgGuiBar/PYZ-00.pyz
Normal file
BIN
build/heif2jpgGuiBar/PYZ-00.pyz
Normal file
Binary file not shown.
1528
build/heif2jpgGuiBar/PYZ-00.toc
Normal file
1528
build/heif2jpgGuiBar/PYZ-00.toc
Normal file
File diff suppressed because it is too large
Load Diff
BIN
build/heif2jpgGuiBar/base_library.zip
Normal file
BIN
build/heif2jpgGuiBar/base_library.zip
Normal file
Binary file not shown.
BIN
build/heif2jpgGuiBar/heif2jpgGuiBar.pkg
Normal file
BIN
build/heif2jpgGuiBar/heif2jpgGuiBar.pkg
Normal file
Binary file not shown.
BIN
build/heif2jpgGuiBar/localpycs/pyimod01_archive.pyc
Normal file
BIN
build/heif2jpgGuiBar/localpycs/pyimod01_archive.pyc
Normal file
Binary file not shown.
BIN
build/heif2jpgGuiBar/localpycs/pyimod02_importers.pyc
Normal file
BIN
build/heif2jpgGuiBar/localpycs/pyimod02_importers.pyc
Normal file
Binary file not shown.
BIN
build/heif2jpgGuiBar/localpycs/pyimod03_ctypes.pyc
Normal file
BIN
build/heif2jpgGuiBar/localpycs/pyimod03_ctypes.pyc
Normal file
Binary file not shown.
BIN
build/heif2jpgGuiBar/localpycs/pyimod04_pywin32.pyc
Normal file
BIN
build/heif2jpgGuiBar/localpycs/pyimod04_pywin32.pyc
Normal file
Binary file not shown.
BIN
build/heif2jpgGuiBar/localpycs/struct.pyc
Normal file
BIN
build/heif2jpgGuiBar/localpycs/struct.pyc
Normal file
Binary file not shown.
57
build/heif2jpgGuiBar/warn-heif2jpgGuiBar.txt
Normal file
57
build/heif2jpgGuiBar/warn-heif2jpgGuiBar.txt
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
|
||||||
|
This file lists modules PyInstaller was not able to find. This does not
|
||||||
|
necessarily mean this module is required for running your program. Python and
|
||||||
|
Python 3rd-party packages include a lot of conditional or optional modules. For
|
||||||
|
example the module 'ntpath' only exists on Windows, whereas the module
|
||||||
|
'posixpath' only exists on Posix systems.
|
||||||
|
|
||||||
|
Types if import:
|
||||||
|
* top-level: imported at the top-level - look at these first
|
||||||
|
* conditional: imported within an if-statement
|
||||||
|
* delayed: imported within a function
|
||||||
|
* optional: imported within a try-except-statement
|
||||||
|
|
||||||
|
IMPORTANT: Do NOT post this list to the issue-tracker. Use it as a basis for
|
||||||
|
tracking down the missing module yourself. Thanks!
|
||||||
|
|
||||||
|
missing module named pyimod02_importers - imported by C:\Users\vanko\anaconda3\envs\heif2jpg\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgutil.py (delayed), C:\Users\vanko\anaconda3\envs\heif2jpg\Lib\site-packages\PyInstaller\hooks\rthooks\pyi_rth_pkgres.py (delayed)
|
||||||
|
missing module named pwd - imported by posixpath (delayed, conditional, optional), shutil (delayed, optional), tarfile (optional), pathlib (delayed, optional), subprocess (delayed, conditional, optional), setuptools._distutils.util (delayed, conditional, optional), netrc (delayed, conditional), getpass (delayed), setuptools._vendor.backports.tarfile (optional), setuptools._distutils.archive_util (optional), http.server (delayed, optional)
|
||||||
|
missing module named grp - imported by shutil (delayed, optional), tarfile (optional), pathlib (delayed, optional), subprocess (delayed, conditional, optional), setuptools._vendor.backports.tarfile (optional), setuptools._distutils.archive_util (optional)
|
||||||
|
missing module named _posixsubprocess - imported by subprocess (conditional), multiprocessing.util (delayed)
|
||||||
|
missing module named fcntl - imported by subprocess (optional)
|
||||||
|
missing module named posix - imported by os (conditional, optional), shutil (conditional), importlib._bootstrap_external (conditional), posixpath (optional)
|
||||||
|
missing module named resource - imported by posix (top-level)
|
||||||
|
missing module named _manylinux - imported by packaging._manylinux (delayed, optional), setuptools._vendor.packaging._manylinux (delayed, optional), wheel.vendored.packaging._manylinux (delayed, optional)
|
||||||
|
missing module named typing_extensions.TypeAlias - imported by setuptools._vendor.typing_extensions (top-level), setuptools._reqs (conditional), setuptools.warnings (conditional), setuptools._path (conditional), setuptools.config.setupcfg (conditional), setuptools.config._apply_pyprojecttoml (conditional), setuptools.dist (conditional), pkg_resources (conditional), setuptools.command.bdist_egg (conditional), setuptools.compat.py311 (conditional)
|
||||||
|
missing module named typing_extensions.Self - imported by setuptools._vendor.typing_extensions (top-level), setuptools.config.expand (conditional), setuptools.config.pyprojecttoml (conditional), setuptools.config._validate_pyproject.error_reporting (conditional), pkg_resources (conditional)
|
||||||
|
missing module named asyncio.DefaultEventLoopPolicy - imported by asyncio (delayed, conditional), asyncio.events (delayed, conditional)
|
||||||
|
missing module named _posixshmem - imported by multiprocessing.resource_tracker (conditional), multiprocessing.shared_memory (conditional)
|
||||||
|
missing module named multiprocessing.set_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
|
||||||
|
missing module named multiprocessing.get_start_method - imported by multiprocessing (top-level), multiprocessing.spawn (top-level)
|
||||||
|
missing module named _frozen_importlib_external - imported by importlib._bootstrap (delayed), importlib (optional), importlib.abc (optional), zipimport (top-level)
|
||||||
|
missing module named multiprocessing.get_context - imported by multiprocessing (top-level), multiprocessing.pool (top-level), multiprocessing.managers (top-level), multiprocessing.sharedctypes (top-level)
|
||||||
|
missing module named multiprocessing.TimeoutError - imported by multiprocessing (top-level), multiprocessing.pool (top-level)
|
||||||
|
missing module named _scproxy - imported by urllib.request (conditional)
|
||||||
|
missing module named termios - imported by getpass (optional), tty (top-level)
|
||||||
|
missing module named multiprocessing.BufferTooShort - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
|
||||||
|
missing module named multiprocessing.AuthenticationError - imported by multiprocessing (top-level), multiprocessing.connection (top-level)
|
||||||
|
missing module named usercustomize - imported by site (delayed, optional)
|
||||||
|
missing module named sitecustomize - imported by site (delayed, optional)
|
||||||
|
missing module named readline - imported by site (delayed, optional), rlcompleter (optional)
|
||||||
|
missing module named trove_classifiers - imported by setuptools.config._validate_pyproject.formats (optional)
|
||||||
|
missing module named typing_extensions.Buffer - imported by setuptools._vendor.typing_extensions (top-level), wheel.wheelfile (conditional)
|
||||||
|
missing module named typing_extensions.Literal - imported by setuptools._vendor.typing_extensions (top-level), setuptools.config._validate_pyproject.formats (conditional)
|
||||||
|
missing module named '_typeshed.importlib' - imported by pkg_resources (conditional)
|
||||||
|
missing module named _typeshed - imported by pkg_resources (conditional), setuptools.glob (conditional), setuptools.compat.py311 (conditional)
|
||||||
|
missing module named jnius - imported by setuptools._vendor.platformdirs.android (delayed, conditional, optional)
|
||||||
|
missing module named android - imported by setuptools._vendor.platformdirs.android (delayed, conditional, optional)
|
||||||
|
missing module named importlib_resources - imported by setuptools._vendor.jaraco.text (optional)
|
||||||
|
excluded module named _frozen_importlib - imported by importlib (optional), importlib.abc (optional), zipimport (top-level)
|
||||||
|
missing module named vms_lib - imported by platform (delayed, optional)
|
||||||
|
missing module named 'java.lang' - imported by platform (delayed, optional)
|
||||||
|
missing module named java - imported by platform (delayed)
|
||||||
|
missing module named _winreg - imported by platform (delayed, optional)
|
||||||
|
missing module named numpy - imported by PIL._typing (conditional, optional)
|
||||||
|
missing module named olefile - imported by PIL.FpxImagePlugin (top-level), PIL.MicImagePlugin (top-level)
|
||||||
|
missing module named PIL._avif - imported by PIL (optional), PIL.AvifImagePlugin (optional)
|
||||||
|
missing module named defusedxml - imported by PIL.Image (optional)
|
||||||
20927
build/heif2jpgGuiBar/xref-heif2jpgGuiBar.html
Normal file
20927
build/heif2jpgGuiBar/xref-heif2jpgGuiBar.html
Normal file
File diff suppressed because it is too large
Load Diff
BIN
dist/heif2jpgGuiBar.exe
vendored
Normal file
BIN
dist/heif2jpgGuiBar.exe
vendored
Normal file
Binary file not shown.
28
heif2jpg.py
Normal file
28
heif2jpg.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
from PIL import Image
|
||||||
|
import pillow_heif
|
||||||
|
import os
|
||||||
|
|
||||||
|
# Automatically register HEIF format with Pillow
|
||||||
|
pillow_heif.register_heif_opener()
|
||||||
|
|
||||||
|
def convert_heif_to_jpg(input_folder, output_folder):
|
||||||
|
os.makedirs(output_folder, exist_ok=True)
|
||||||
|
|
||||||
|
for filename in os.listdir(input_folder):
|
||||||
|
if filename.lower().endswith(('.heif', '.heic')):
|
||||||
|
input_path = os.path.join(input_folder, filename)
|
||||||
|
output_path = os.path.join(output_folder, os.path.splitext(filename)[0] + '.jpg')
|
||||||
|
|
||||||
|
try:
|
||||||
|
with Image.open(input_path) as img:
|
||||||
|
rgb_img = img.convert("RGB")
|
||||||
|
rgb_img.save(output_path, "JPEG")
|
||||||
|
print(f"Converted: {filename} -> {output_path}")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Failed to convert {filename}: {e}")
|
||||||
|
|
||||||
|
# Example usage:
|
||||||
|
convert_heif_to_jpg("D:/3D/Majka/heic", "D:/3D/Majka/jpg")
|
||||||
|
|
||||||
|
# convert_heif_to_jpg(r"D:\3D\Majka\heic", r"D:\3D\Majka\jpg") shpuld also work
|
||||||
|
# convert_heif_to_jpg("D:\\3D\\Majka\\heic", "D:\\3D\\Majka\\jpg") should also work
|
||||||
60
heif2jpgGui.py
Normal file
60
heif2jpgGui.py
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
import os
|
||||||
|
from tkinter import Tk, filedialog, Button, Label
|
||||||
|
from PIL import Image
|
||||||
|
import pillow_heif
|
||||||
|
|
||||||
|
# Enable HEIF support in Pillow
|
||||||
|
pillow_heif.register_heif_opener()
|
||||||
|
|
||||||
|
def convert_heif_to_jpg_gui(input_folder, output_folder):
|
||||||
|
os.makedirs(output_folder, exist_ok=True)
|
||||||
|
|
||||||
|
for filename in os.listdir(input_folder):
|
||||||
|
if filename.lower().endswith(('.heic', '.heif')):
|
||||||
|
input_path = os.path.join(input_folder, filename)
|
||||||
|
output_path = os.path.join(output_folder, os.path.splitext(filename)[0] + '.jpg')
|
||||||
|
try:
|
||||||
|
with Image.open(input_path) as img:
|
||||||
|
rgb_img = img.convert("RGB")
|
||||||
|
rgb_img.save(output_path, "JPEG")
|
||||||
|
print(f"Converted: {filename}")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Failed to convert {filename}: {e}")
|
||||||
|
|
||||||
|
def browse_input():
|
||||||
|
folder = filedialog.askdirectory(title="Select Input Folder (HEIF images)")
|
||||||
|
if folder:
|
||||||
|
input_label.config(text=folder)
|
||||||
|
app.input_folder = folder
|
||||||
|
|
||||||
|
def browse_output():
|
||||||
|
folder = filedialog.askdirectory(title="Select Output Folder (JPG images)")
|
||||||
|
if folder:
|
||||||
|
output_label.config(text=folder)
|
||||||
|
app.output_folder = folder
|
||||||
|
|
||||||
|
def convert():
|
||||||
|
if hasattr(app, "input_folder") and hasattr(app, "output_folder"):
|
||||||
|
convert_heif_to_jpg_gui(app.input_folder, app.output_folder)
|
||||||
|
status_label.config(text="✅ Conversion complete!")
|
||||||
|
else:
|
||||||
|
status_label.config(text="❗ Please select both folders first.")
|
||||||
|
|
||||||
|
# GUI Setup
|
||||||
|
app = Tk()
|
||||||
|
app.title("HEIF to JPG Converter")
|
||||||
|
app.geometry("500x200")
|
||||||
|
|
||||||
|
Button(app, text="Select HEIF Input Folder", command=browse_input).pack(pady=5)
|
||||||
|
input_label = Label(app, text="No input folder selected")
|
||||||
|
input_label.pack()
|
||||||
|
|
||||||
|
Button(app, text="Select JPG Output Folder", command=browse_output).pack(pady=5)
|
||||||
|
output_label = Label(app, text="No output folder selected")
|
||||||
|
output_label.pack()
|
||||||
|
|
||||||
|
Button(app, text="Convert HEIF to JPG", command=convert).pack(pady=10)
|
||||||
|
status_label = Label(app, text="")
|
||||||
|
status_label.pack()
|
||||||
|
|
||||||
|
app.mainloop()
|
||||||
78
heif2jpgGuiBar.py
Normal file
78
heif2jpgGuiBar.py
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
import os
|
||||||
|
from tkinter import Tk, filedialog, Button, Label, ttk
|
||||||
|
from PIL import Image
|
||||||
|
import pillow_heif
|
||||||
|
|
||||||
|
# Register HEIF support
|
||||||
|
pillow_heif.register_heif_opener()
|
||||||
|
|
||||||
|
def convert_heif_to_jpg_gui(input_folder, output_folder):
|
||||||
|
os.makedirs(output_folder, exist_ok=True)
|
||||||
|
|
||||||
|
files = [f for f in os.listdir(input_folder) if f.lower().endswith(('.heic', '.heif'))]
|
||||||
|
total = len(files)
|
||||||
|
|
||||||
|
if total == 0:
|
||||||
|
status_label.config(text="⚠️ No HEIF/HEIC files found.")
|
||||||
|
return
|
||||||
|
|
||||||
|
progress_bar["maximum"] = total
|
||||||
|
|
||||||
|
for i, filename in enumerate(files, 1):
|
||||||
|
input_path = os.path.join(input_folder, filename)
|
||||||
|
output_path = os.path.join(output_folder, os.path.splitext(filename)[0] + '.jpg')
|
||||||
|
|
||||||
|
try:
|
||||||
|
with Image.open(input_path) as img:
|
||||||
|
rgb_img = img.convert("RGB")
|
||||||
|
rgb_img.save(output_path, "JPEG")
|
||||||
|
status_label.config(text=f"Converting {filename} ({i}/{total})")
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Failed to convert {filename}: {e}")
|
||||||
|
|
||||||
|
progress_bar["value"] = i
|
||||||
|
app.update_idletasks()
|
||||||
|
|
||||||
|
status_label.config(text="✅ Conversion complete!")
|
||||||
|
|
||||||
|
def browse_input():
|
||||||
|
folder = filedialog.askdirectory(title="Select Input Folder (HEIF images)")
|
||||||
|
if folder:
|
||||||
|
input_label.config(text=folder)
|
||||||
|
app.input_folder = folder
|
||||||
|
|
||||||
|
def browse_output():
|
||||||
|
folder = filedialog.askdirectory(title="Select Output Folder (JPG images)")
|
||||||
|
if folder:
|
||||||
|
output_label.config(text=folder)
|
||||||
|
app.output_folder = folder
|
||||||
|
|
||||||
|
def convert():
|
||||||
|
if hasattr(app, "input_folder") and hasattr(app, "output_folder"):
|
||||||
|
convert_heif_to_jpg_gui(app.input_folder, app.output_folder)
|
||||||
|
else:
|
||||||
|
status_label.config(text="❗ Please select both folders first.")
|
||||||
|
|
||||||
|
# GUI Setup
|
||||||
|
app = Tk()
|
||||||
|
app.title("HEIF to JPG Converter")
|
||||||
|
app.geometry("500x250")
|
||||||
|
|
||||||
|
Button(app, text="Select HEIF Input Folder", command=browse_input).pack(pady=5)
|
||||||
|
input_label = Label(app, text="No input folder selected")
|
||||||
|
input_label.pack()
|
||||||
|
|
||||||
|
Button(app, text="Select JPG Output Folder", command=browse_output).pack(pady=5)
|
||||||
|
output_label = Label(app, text="No output folder selected")
|
||||||
|
output_label.pack()
|
||||||
|
|
||||||
|
Button(app, text="Convert HEIF to JPG", command=convert).pack(pady=10)
|
||||||
|
|
||||||
|
# Progress bar
|
||||||
|
progress_bar = ttk.Progressbar(app, orient="horizontal", length=400, mode="determinate")
|
||||||
|
progress_bar.pack(pady=5)
|
||||||
|
|
||||||
|
status_label = Label(app, text="")
|
||||||
|
status_label.pack()
|
||||||
|
|
||||||
|
app.mainloop()
|
||||||
39
heif2jpgGuiBar.spec
Normal file
39
heif2jpgGuiBar.spec
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
# -*- mode: python ; coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
a = Analysis(
|
||||||
|
['heif2jpgGuiBar.py'],
|
||||||
|
pathex=[],
|
||||||
|
binaries=[],
|
||||||
|
datas=[],
|
||||||
|
hiddenimports=[],
|
||||||
|
hookspath=[],
|
||||||
|
hooksconfig={},
|
||||||
|
runtime_hooks=[],
|
||||||
|
excludes=[],
|
||||||
|
noarchive=False,
|
||||||
|
optimize=0,
|
||||||
|
)
|
||||||
|
pyz = PYZ(a.pure)
|
||||||
|
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.datas,
|
||||||
|
[],
|
||||||
|
name='heif2jpgGuiBar',
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
upx_exclude=[],
|
||||||
|
runtime_tmpdir=None,
|
||||||
|
console=False,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch=None,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None,
|
||||||
|
icon=['Heif2Jpg.ico'],
|
||||||
|
)
|
||||||
Reference in New Issue
Block a user