Moved optima file class to its own folder.

This commit is contained in:
Mr Finchum 2024-12-31 12:05:28 +01:00
parent f542e857ff
commit 1285e5a844
2 changed files with 8 additions and 2 deletions

0
optima/__init__.py Normal file
View file

View file

@ -1,6 +1,7 @@
import re import re
import os
from datetime import datetime from datetime import datetime
#from utils.utility import Utilities # My packages
from utils.image_handler import ImageProcessor, ExifHandler from utils.image_handler import ImageProcessor, ExifHandler
class OPTIMA35: class OPTIMA35:
@ -29,7 +30,7 @@ class OPTIMA35:
"optimize": False, "optimize": False,
"gps": False "gps": False
} }
self.selected_exif = None self.selected_exif = {}
def modify_timestamp_in_exif(self, exif_data, filename): def modify_timestamp_in_exif(self, exif_data, filename):
""""Takes exif data and adjust time to fit ending of filename.""" """"Takes exif data and adjust time to fit ending of filename."""
@ -50,6 +51,7 @@ class OPTIMA35:
def process(self, image_input_file, image_output_file): def process(self, image_input_file, image_output_file):
with self.image_processor.open_image(image_input_file) as img: with self.image_processor.open_image(image_input_file) as img:
processed_img = img processed_img = img
image_name = os.path.basename(image_output_file)
if self.settings["resize"] != False: if self.settings["resize"] != False:
processed_img = self.image_processor.resize_image( processed_img = self.image_processor.resize_image(
@ -107,3 +109,7 @@ class OPTIMA35:
ending_number = current_image ending_number = current_image
ending = f"{ending_number:0{total_digits}}" ending = f"{ending_number:0{total_digits}}"
return f"{base_name}_{ending}" return f"{base_name}_{ending}"
if __name__ == "__main__":
print("Please load OPTIMA35 into the ui class...")
exit()