Skip to content

Commit

Permalink
Fix orientation for HEIC / HEIF files. Bumped up version to 1.0.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
sabaatworld committed Feb 22, 2021
1 parent dd090ee commit f1d9c6c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packaging/batch-media-compressor.spec
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ app = BUNDLE(exe,
info_plist={
'LSUIElement': True,
'CFBundleDisplayName': 'Batch Media Compressor',
'CFBundleShortVersionString': '1.0.0',
'CFBundleVersion': '1.0.0',
'CFBundleShortVersionString': '1.0.1',
'CFBundleVersion': '1.0.1',
'NSHumanReadableCopyright': 'Copyright © 2020 Two Hand Apps. All rights reserved.',
'LSApplicationCategoryType': 'public.app-category.photography',
'NSRequiresAquaSystemAppearance': True # TODO: Support dark mode
Expand Down
4 changes: 2 additions & 2 deletions packaging/win_exe_version_info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ VSVersionInfo(
u'040904B0',
[StringStruct(u'CompanyName', u'Two Hand Apps'),
StringStruct(u'FileDescription', u'Batch Media Compressor'),
StringStruct(u'FileVersion', u'1.0.0'),
StringStruct(u'FileVersion', u'1.0.1'),
StringStruct(u'InternalName', u'Batch Media Compressor'),
StringStruct(u'LegalCopyright', u'Copyright \xa9 2020 Two Hand Apps. All rights reserved.'),
StringStruct(u'OriginalFilename', u'Batch Media Compressor.exe'),
StringStruct(u'ProductName', u'Batch Media Compressor'),
StringStruct(u'ProductVersion', u'1.0.0')])
StringStruct(u'ProductVersion', u'1.0.1')])
]),
VarFileInfo([VarStruct(u'Translation', [0x409, 1252])])
]
Expand Down
2 changes: 1 addition & 1 deletion packaging/win_setup.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Batch Media Compressor"
#define MyAppVersion "1.0.0"
#define MyAppVersion "1.0.1"
#define MyAppPublisher "Two Hand Apps"
#define MyAppURL "https://github.com/sabaatworld/batch-media-compressor"
#define MyAppExeName "Batch Media Compressor.exe"
Expand Down
11 changes: 7 additions & 4 deletions pie/core/media_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def conversion_process_exec(media_file_path: str, target_gpu: int, save_file_pat
MediaProcessor.convert_image_file(settings, media_file, original_file_path, save_file_path)
if ScannedFileType.VIDEO.name == media_file.file_type:
MediaProcessor.convert_video_file(settings, media_file, original_file_path, save_file_path, target_gpu)
MediaProcessor.copy_exif_to_file(settings, original_file_path, save_file_path, media_file.video_rotation)
MediaProcessor.copy_exif_to_file(settings, original_file_path, save_file_path, media_file)
media_file.converted_file_hash = MiscUtils.generate_hash(save_file_path)
media_file.conversion_settings_hash = conversion_settings_hash
with save_file_path_computation_lock:
Expand Down Expand Up @@ -147,10 +147,13 @@ def convert_video_file(settings: Settings, media_file: MediaFile, original_file_
MiscUtils.exec_subprocess(args, "Video conversion failed")

@staticmethod
def copy_exif_to_file(settings: Settings, original_file_path: str, new_file_path: str, rotation: str):
def copy_exif_to_file(settings: Settings, original_file_path: str, new_file_path: str, media_file: MediaFile):
args = [settings.path_exiftool, "-overwrite_original", "-tagsFromFile", original_file_path, new_file_path]
if rotation:
args.insert(4, "-rotation={}".format(rotation))
if ScannedFileType.VIDEO.name == media_file.file_type and media_file.video_rotation:
args.insert(4, "-rotation={}".format(media_file.video_rotation))
if ScannedFileType.IMAGE.name == media_file.file_type and media_file.extension in ["HEIC", "HEIF"]:
args.insert(4, "-x")
args.insert(5, "Orientation")
MiscUtils.exec_subprocess(args, "EXIF copy failed")

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion pie/tray_icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


class TrayIcon(QtWidgets.QSystemTrayIcon):
__APP_VER = "1.0.0"
__APP_VER = "1.0.1"
__logger = logging.getLogger('TrayIcon')

def __init__(self, log_queue: Queue):
Expand Down

0 comments on commit f1d9c6c

Please sign in to comment.