WallaceBuilds / quick-compact

A batch image compression tool
0 stars 0 forks source link

Renaming/Obscuring File Types #1

Open WallaceBuilds opened 6 years ago

WallaceBuilds commented 6 years ago

When a file type is renamed, for example .PNG being renamed to .JPG, the script cannot process the file. Under the current method, this will cause the script to crash. With the new update (0.9.1), the file will be passed over. However, this also means that the image can be compressed but it needs to be determined by its actual file type. I will investigate this issue further and update with any progress made.

Thank you Bandit for finding this issue!

Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\Bandit\AppData\Local\Programs\Python\Python35-32\lib\site-packages\PIL\JpegImagePlugin.py", line 621, in _save rawmode = RAWMODE[im.mode] KeyError: 'RGBA'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Bandit\AppData\Local\Programs\Python\Python35-32\lib\tkinter__init.py", line 1549, in call__ return self.func(*args) File "C:\Users\Bandit\Desktop\quick-compact-0.9\qcGUI.py", line 437, in confirm compressor() File "C:\Users\Bandit\Desktop\quick-compact-0.9\qcGUI.py", line 195, in compressor source.save(destDir + imageNames[i] ,optimize=opti,quality=resultQ)

WallaceBuilds commented 6 years ago

Under 0.9.1, this exception will likely result in the image being thrown out of the job. Still needs to be tested.