Commit Graph

11 Commits

Author SHA1 Message Date
d8858c78bb Thumbnails: crop from original size if 2x is unavailable 2022-07-07 14:54:00 +02:00
c0d69f7205 Do not delete thumbnail queue when replacing an asset
Thumbnails are normally created on demand, e.g. when processing the format codes in a post's body text.
Normally, the temporary URL is only used once to generate thumbnails ad-hoc. However, when cache is
enabled, a reference to the asset may be used in a cached version of a formatted body text, skipping
the normal thumbnail generation routine.

When an asset is replaced, currently, all thumbnails are removed and references to them are removed
from the database. In case the asset is still referenced in a cached formatted body text, this could lead
to an error when requesting the thumbnail, as the thumbnail request is no longer present in the system.

As we do not know what posts use particular assets at this point in the code, it is best to work around this
issue by unsetting the thumbnail filenames rather than deleting the entries outright. This effectively
generates them again on the next request.

In the future, we should aim to keep track of what posts make use of assets, so cache may be invalidated
in a more targeted way.
2022-07-07 14:22:22 +02:00
b5edf09a69 Don't try to generate double-density thumbs for small images 2022-07-07 14:05:33 +02:00
fc59708914 Split Image::getImageUrls from Image::getInlineImage 2022-07-05 12:01:02 +02:00
1c02cbea93 Rewrite Image::getInlineImage to support double density displays 2022-07-05 11:41:40 +02:00
52420b8715 Add Image::getInlineImage method 2022-06-30 15:22:08 +02:00
e7490e40dd Clean up and force a rebuild of thumbnails when customising a crop region. 2020-12-30 13:05:23 +01:00
5df7ea8371 Remove unused 'best color' algorithm.
This code is used to efficiently determine the most saturated colour in an image,
Kabuki uses this as the highlight colour on a page, but this styling has always
been disabled in HashRU Pics. Hence, we can safely remove the code, freeing up
some CPU cycles in the process. ;-)
2019-09-29 14:18:59 +02:00
1def1484cb Backport asynchronous thumbnail generation from Kabuki. 2017-12-20 14:51:23 +01:00
aa04c5ee04 Reduce JPEG quality for thumbnails. 2017-11-09 17:00:35 +01:00
ab0e4efbcb Initial commit.
This is to be the new HashRU website based on the Aaronweb.net/Kabuki CMS.
2017-11-09 17:00:22 +01:00