Files
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
..
2023-05-05 00:59:00 +02:00
2023-06-24 00:45:42 +02:00
2023-01-05 13:01:13 +01:00
2023-06-15 01:03:56 +02:00
2023-05-05 00:59:00 +02:00