HaW-Tagger / HWtagger

A tagging software made to tag images. It's primary use is for training Stable Diffusion checkpoints and loras.
GNU General Public License v3.0
12 stars 1 forks source link

PIL.Image.DecompressionBombError #2

Closed Fluboxer closed 1 month ago

Fluboxer commented 2 months ago

This thing is smart enough to not cease tagging if image is ungodly big, but is not smart enough to just skip it while viewing database As bonus it won't even tell you what file was that

Traceback (most recent call last): File "C:\Users\Fluboxer\Downloads\tagger\pyside6_ui.py", line 686, in view_database_button self.add_db_tab_widget(temp_db) File "C:\Users\Fluboxer\Downloads\tagger\pyside6_ui.py", line 689, in add_db_tab_widget main_widget = DatabaseViewBase.DatabaseViewBase(db) File "C:\Users\Fluboxer\Downloads\tagger\DatabaseViewBase.py", line 435, in init self.init_image_view() File "C:\Users\Fluboxer\Downloads\tagger\DatabaseViewBase.py", line 570, in init_image_view self.db.create_images_objects(self.image_load_size) File "C:\Users\Fluboxer\Downloads\tagger\classes\class_database.py", line 305, in create_imagesobjects for in main.tqdm_parallel_map(pool, lambda image: image.load_image_object((max_image_size, max_image_size)), self.images): File "C:\Users\Fluboxer\Downloads\tagger\tools\main.py", line 161, in tqdm_parallel_map yield f.result() File "C:\Program Files\Python310\lib\concurrent\futures_base.py", line 451, in result return self.get_result() File "C:\Program Files\Python310\lib\concurrent\futures_base.py", line 403, in get_result raise self._exception File "C:\Program Files\Python310\lib\concurrent\futures\thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "C:\Users\Fluboxer\Downloads\tagger\classes\classdatabase.py", line 305, in for in main.tqdm_parallel_map(pool, lambda image: image.load_image_object((max_image_size, max_image_size)), self.images): File "C:\Users\Fluboxer\Downloads\tagger\classes\class_image.py", line 537, in load_image_object self.image_object = Image.open(self.path) File "C:\Users\Fluboxer\Downloads\tagger.venv\lib\site-packages\PIL\Image.py", line 3477, in open im = _open_core(fp, filename, prefix, formats) File "C:\Users\Fluboxer\Downloads\tagger.venv\lib\site-packages\PIL\Image.py", line 3466, in _open_core _decompression_bomb_check(im.size) File "C:\Users\Fluboxer\Downloads\tagger.venv\lib\site-packages\PIL\Image.py", line 3365, in _decompression_bomb_check raise DecompressionBombError(msg) PIL.Image.DecompressionBombError: Image size (463708672 pixels) exceeds limit of 357913940 pixels, could be decompression bomb DOS attack.

PhoenixAscencio commented 2 months ago

Hello, I added a fix for this that is not currently available for everyone, but this is taken into account, The next update will have a lot of feature but making them available for everyone before testing could break the databases so we prefer to wait before adding them.