mirror-komikku/komikku
Colin 318fc0c975 crop_borders: don't crash on empty image
PIL's `Image.getbbox` documentation shows:
```
:returns: The bounding box is returned as a 4-tuple defining the
   left, upper, right, and lower pixel coordinate. See
   :ref:`coordinate-system`. If the image is completely empty, this
   method returns None.
```

when this returns `None`, komikku would error with a trace like so:
```
Traceback (most recent call last):
  File "komikku/reader/pager/image.py", line 426, in do_snapshot
    self.texture_crop = Gdk.Texture.new_for_pixbuf(crop_borders())
  File "komikku/reader/pager/image.py", line 419, in crop_borders
    if bbox[2] - bbox[0] < self.pixbuf.get_width() or bbox[3] - bbox[1] < self.pixbuf.get_height():
TypeError: 'NoneType' object is not subscriptable
```
2023-07-12 08:55:29 +00:00
..
card [L10n] Fixes plural strings that were not detected 2023-06-13 17:06:44 +02:00
explorer [Code] Makes Linters happier 2023-05-05 00:59:00 +02:00
library [L10n] Fixes plural strings that were not detected 2023-06-13 17:06:44 +02:00
models [Servers] Create the manga directory on update if it's missing 2023-06-12 23:17:35 +00:00
reader crop_borders: don't crash on empty image 2023-07-12 08:55:29 +00:00
servers [Servers] Adds PhenixScans [FR] 2023-06-24 00:45:42 +02:00
activity_indicator.py Updates copyrights 2023-01-05 13:01:13 +01:00
application.py New release 1.22.0 2023-06-15 01:03:56 +02:00
categories_editor.py [Code] Fixes deprecated warnings 2023-04-27 08:21:58 +02:00
debug_info.py [Webview] Removes WebKit2Gtk-5.0 support 2023-03-31 13:17:23 +02:00
downloader.py [L10n] Fixes plural strings that were not detected 2023-06-13 17:06:44 +02:00
history.py [Code] Stops usage of deprecated Gtk.Widget methods `show` and `hide` 2023-03-04 00:49:43 +01:00
preferences.py [Code] Makes Linters happier 2023-05-05 00:59:00 +02:00
updater.py [L10n] Fixes plural strings that were not detected 2023-06-13 17:06:44 +02:00
utils.py crop_borders: don't crash on empty image 2023-07-12 08:55:29 +00:00
webview.py [Webview] bypass_cf: Exit from webview if end of chalenge has not been detected in on_load_changed 2023-06-15 16:44:56 +02:00