Kilian / Trimage

A cross-platform tool for optimizing PNG and JPG files.
http://trimage.org
MIT License
706 stars 55 forks source link

Crash when processing multiple files #73

Closed City-busz closed 4 years ago

City-busz commented 4 years ago

When I drag and drop multiple image files (2 JPG, 2 PNG) at once to the window, the application crashes every time with the following traceback:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/trimage/trimage.py", line 286, in data
    data = self.imagelist[index.row()][index.column()]
  File "/usr/lib/python3.8/site-packages/trimage/trimage.py", line 340, in __getitem__
    return self.d[key](self.image)
  File "/usr/lib/python3.8/site-packages/trimage/trimage.py", line 308, in <lambda>
    'filename_w_ext': lambda i: self.statusStr() % i.filename_w_ext,
TypeError: not all arguments converted during string formatting

It doesn't happen if I drop these files individually, but also happens when I click on the "Recompress" button.

Kilian commented 4 years ago

What are the filenames? It could be trimage has a hard time with those.

City-busz commented 4 years ago

These are the filenames for my test:

/home/user/image1.png
/home/user/image2.png
/home/user/image3.jpg
/home/user/image4.jpg
City-busz commented 4 years ago

When I drag and drop just 2 JPG files, or just 2 PNG files, the crush does not occur. It happens only when I mix JPG and PNG files.

Kilian commented 4 years ago

Interesting, I'll look into it! :)