Commit Graph

123 Commits

Author SHA1 Message Date
Aaron 49390c372d Use triple-equals in a few more places 2022-12-25 13:50:03 +01:00
Aaron 2174e1d08b PhotoPage: show software used to edit photo 2022-12-25 13:44:19 +01:00
Aaron 3de87809bb GenericTable: prevent passing NULL to strtotime 2022-07-14 16:45:32 +02:00
Aaron c763967463 Prevent current page from being 0 if no items are present 2022-07-14 16:45:17 +02:00
Aaron b3808144ca Address deprecation notices for certain function signatures 2022-07-08 23:52:03 +02:00
Aaron d8858c78bb Thumbnails: crop from original size if 2x is unavailable 2022-07-07 14:54:00 +02:00
Aaron 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
Aaron b5edf09a69 Don't try to generate double-density thumbs for small images 2022-07-07 14:05:33 +02:00
Aaron 54fb7ab410 Write new thumbnail filenames to parent Image object as well 2022-07-07 13:55:55 +02:00
Aaron 086102d007 Thumbnail class: minor refactor of generate method 2022-07-07 13:51:03 +02:00
Aaron 56b60b74bc Thumbnail class: refactor getUrl method 2022-07-07 13:33:40 +02:00
Aaron fc59708914 Split Image::getImageUrls from Image::getInlineImage 2022-07-05 12:01:02 +02:00
Aaron 1c02cbea93 Rewrite Image::getInlineImage to support double density displays 2022-07-05 11:41:40 +02:00
Aaron 52420b8715 Add Image::getInlineImage method 2022-06-30 15:22:08 +02:00
electricdusk b7a37c85f6 Complete date-ordered orderings
Bug as reported by Yorick: When two Assets have the same capture
date, a bug occurs in the interface where the user gets stuck in
a loop when moving to the next image.

This patch uses the primary key as a fallback when ordering the
images by capture date.  This way, the asset ordering is complete
and it should resolve the bug.
2022-11-22 12:00:53 +01:00
Aaron 0ec0de4414 Replace deprecated strftime calls 2022-05-07 13:25:19 +02:00
minnozz f2d8a32e67 EXIF: prefer DateTimeOriginal over DateTimeDigitized 2022-02-16 21:43:55 +01:00
Aaron 237f4005bd Apply htmlspecialchars to basic values. 2021-02-17 22:44:26 +01:00
Aaron 4bf4641428 Minor refactor of generateColumnHeaders function 2021-02-17 20:45:58 +01:00
Aaron ff808ba18d Refactor processing of raw rows and their cell data. 2021-02-17 20:45:22 +01:00
Aaron 6c662481bc Remove a few obscure, unused features.
* Removed support for row classification. Use of CSS is preferred.
* Removed support for disabling/enabling columns via a property. Unset as needed.
* Removed support for passing and inheriting a cell width by column. Header width suffices.
2021-02-17 20:45:22 +01:00
Aaron af73f00701 Restrict access to GenericTable, Pagination class members. 2021-02-17 20:45:21 +01:00
Aaron 681af07985 Pass builder function for custom pagination link generation.
This makes pagination for GenericTables work properly again.
2021-02-17 20:43:30 +01:00
Aaron cba42a9129 Refactor GenericTable to use PageIndex rather than inherit from it
This has on my todo list for years... I'm glad to finally get around to it.
2021-02-17 20:43:30 +01:00
Aaron 96937b6952 Use null-coalescing operator where appropriate 2021-02-17 20:43:29 +01:00
Aaron 5c55e45c3c Use splat operator instead of call_user_func_array 2021-02-17 20:43:29 +01:00
Aaron 555c61937b Minor Thumbnail refactors from upstream Kabuki. 2020-12-30 20:09:10 +01:00
Aaron d069ddca18 Merge pull request 'Make crop editor usable' (#22) from crop-editor into master
Reviewed-on: #22
2020-12-30 20:06:15 +01:00
Aaron 71b71f8a03 Merge pull request 'Set JPEG compression to 80 for thumbnails' (#21) from thumbnail-quality into master
Reviewed-on: #21
2020-12-30 20:05:46 +01:00
Aaron e7490e40dd Clean up and force a rebuild of thumbnails when customising a crop region. 2020-12-30 13:05:23 +01:00
Aaron b793e05980 Re-assign thumbnail suffix for CROP_MODE_BOUNDARY.
This crop mode was intended to get the '_ce' suffix,
but was inadvertently getting '_c' instead.
2020-12-30 13:05:22 +01:00
Aaron 8d02662eb3 Set JPEG compression to 80 for thumbnails.
This saves both disk space and bandwidth by compromising a little on quality.
Only thumbnails are affected; full-size images are still saved in full detail.
2020-03-22 22:56:53 +01:00
Aaron a208c0482f Invoke Dispatcher::kickGuest from Session for invalid sessions.
Previously, a NotAllowedException would be thrown if an invalid session
was encountered. However, these exceptions were not caught, and hence
would yield a fatal uncaught exception error.

At this point in Kabuki, the ErrorHandler class has not been registered yet
for error handling purposes. This error is therefore not visible if the PHP
ini directive 'display_errors' is set to 'Off'. As this is the default
production value, the script would fail with a blank page in such cases.
2020-03-11 22:38:15 +01:00
Aaron f193b614b7 Port basic asset management page from Kabuki. 2020-02-25 13:31:12 +01:00
Aaron c48ba786c1 Refactor leftover old-style arrays into new-style arrays. 2019-09-29 14:47:56 +02:00
Aaron d7b68995e8 Fix recounting not working on non-album tags. 2019-09-29 14:20:59 +02:00
Aaron 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
Aaron 05c48be785 Link tags after adding them through autosuggest. 2019-03-09 13:22:32 +01:00
Roflin 20db3561cf Adds the ability to export an album using streaming tar. 2019-03-08 19:52:01 +00:00
Roflin 768f5ee529 Fixes an error related to using continue within a loop.
https://wiki.php.net/rfc/continue_on_switch_deprecation
2019-03-08 19:52:01 +00:00
Roflin 16ec547064 Changes the ConfirmDelete page and updates database code.
The ConfirmDelete page now uses parts of the photopage. The
Confirmation dialog is its own template which is based on Alert.

The database now updates the album thumb to the most recent
addition to the album, when the album thumb asset is being deleted.
When there are no pictures left in the album 0 will be set.
2018-07-13 23:00:36 +02:00
Roflin e40c05c1f8 Adds a Confirm Delete page and actually delete the assets. 2018-07-07 19:53:46 +00:00
Aaron bcbb74a680 Allow setting URL slug through admin panel. 2018-02-22 20:07:06 +01:00
Roflin 8b73420936 Makes the Reply-To header e-mail address configurable.
also uses the SITE_NAME constant as the sender name.
2018-02-03 20:58:00 +01:00
Aaron ee304dd7b9 When generating thumbnails, infer width properly when null is passed. 2018-02-03 20:14:40 +01:00
Aaron 1def1484cb Backport asynchronous thumbnail generation from Kabuki. 2017-12-20 14:51:23 +01:00
Aaron 096cea078c Support 'quick create subalbums' style, too. 2017-11-09 17:00:36 +01:00
Aaron 2a25434862 Implement basic tag management. 2017-11-09 17:00:36 +01:00
Aaron 943297900c Implement basic album management. 2017-11-09 17:00:36 +01:00
Aaron 95e289d82d Introduce an overview of all albums for admins. 2017-11-09 17:00:36 +01:00