Commit Graph

176 Commits

Author SHA1 Message Date
Aaron van Geffen 187a7cd02f GenericTable: prevent passing NULL to strtotime 2022-07-14 16:45:32 +02:00
Aaron van Geffen 8414843bbf Prevent current page from being 0 if no items are present 2022-07-14 16:45:17 +02:00
Aaron van Geffen 474c387786 Add double-density thumbnails to albums and photo pages 2022-07-08 23:53:28 +02:00
Aaron van Geffen 12407d797d Address deprecation notices for certain function signatures 2022-07-08 23:52:03 +02:00
Aaron van Geffen 64d7433a56 Thumbnails: crop from original size if 2x is unavailable 2022-07-08 23:49:29 +02:00
Aaron van Geffen 58b7204fbf 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-08 23:49:20 +02:00
Aaron van Geffen 36a2779381 Don't try to generate double-density thumbs for small images 2022-07-08 23:49:13 +02:00
Aaron van Geffen 44bb501d13 Write new thumbnail filenames to parent Image object as well 2022-07-08 23:48:53 +02:00
Aaron van Geffen 9010123d18 Thumbnail class: minor refactor of generate method 2022-07-08 23:48:45 +02:00
Aaron van Geffen e3b67c4022 Thumbnail class: refactor getUrl method 2022-07-08 23:48:38 +02:00
Aaron van Geffen 2bcdc5fe6e Split Image::getImageUrls from Image::getInlineImage 2022-07-08 23:48:30 +02:00
Aaron van Geffen edfad992cc Rewrite Image::getInlineImage to support double density displays 2022-07-08 23:48:19 +02:00
Aaron van Geffen 357d95f6ff Add Image::getInlineImage method 2022-07-08 23:47:55 +02:00
Aaron van Geffen 0ec0de4414 Replace deprecated strftime calls 2022-05-07 13:25:19 +02:00
Roflin 69417c36ed Merge pull request 'EXIF: prefer DateTimeOriginal over DateTimeDigitized' (#27) from exif-date-time-original into master
Reviewed-on: Public/pics#27
2022-02-16 21:56:04 +01:00
Bart Schuurmans f2d8a32e67 EXIF: prefer DateTimeOriginal over DateTimeDigitized 2022-02-16 21:43:55 +01:00
Roflin 4863561129 Merge pull request 'Refactor generic tables and page index classes' (#26) from refactor-tables into master
Reviewed-on: Public/pics#26
2021-05-17 20:19:18 +02:00
Roflin 8474d3b2b2 Merge pull request 'Modernise autosuggest code' (#25) from autosuggest into master
Reviewed-on: Public/pics#25
2021-05-17 20:19:05 +02:00
Aaron van Geffen 3bf69fd21f Prevent XSS in error log viewer. 2021-03-10 17:40:06 +01:00
Aaron van Geffen 237f4005bd Apply htmlspecialchars to basic values. 2021-02-17 22:44:26 +01:00
Aaron van Geffen 4bf4641428 Minor refactor of generateColumnHeaders function 2021-02-17 20:45:58 +01:00
Aaron van Geffen ff808ba18d Refactor processing of raw rows and their cell data. 2021-02-17 20:45:22 +01:00
Aaron van Geffen 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 van Geffen af73f00701 Restrict access to GenericTable, Pagination class members. 2021-02-17 20:45:21 +01:00
Aaron van Geffen 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 van Geffen 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 van Geffen 96937b6952 Use null-coalescing operator where appropriate 2021-02-17 20:43:29 +01:00
Aaron van Geffen 5c55e45c3c Use splat operator instead of call_user_func_array 2021-02-17 20:43:29 +01:00
Aaron van Geffen 70e6001c85 Replace event.keyCode with event.key equivalents. 2021-02-16 15:26:57 +01:00
Aaron van Geffen 4402521051 Highlight matching string in autosuggest entries. 2021-02-15 12:14:24 +01:00
Aaron van Geffen 889302cd36 Modernise AutoSuggest and TagAutoSuggest classes. 2021-02-15 12:14:23 +01:00
Aaron van Geffen cae5c6e5cf Merge pull request 'Add readme and license files' (#24) from readme into master
Reviewed-on: Public/pics#24
2020-12-30 20:09:04 +01:00
Aaron van Geffen 162d14b35f Merge pull request 'Refactor work for Thumbnail class' (#23) from thumbnail-refactor into master
Reviewed-on: Public/pics#23
2020-12-30 20:08:02 +01:00
Aaron van Geffen 555c61937b Minor Thumbnail refactors from upstream Kabuki. 2020-12-30 20:09:10 +01:00
Aaron van Geffen d069ddca18 Merge pull request 'Make crop editor usable' (#22) from crop-editor into master
Reviewed-on: Public/pics#22
2020-12-30 20:06:15 +01:00
Aaron van Geffen 71b71f8a03 Merge pull request 'Set JPEG compression to 80 for thumbnails' (#21) from thumbnail-quality into master
Reviewed-on: Public/pics#21
2020-12-30 20:05:46 +01:00
Aaron van Geffen 2885e24456 Merge pull request 'Prevent blank pages on session errors' (#20) from session-errors into master
Reviewed-on: Public/pics#20
2020-12-30 20:05:27 +01:00
Aaron van Geffen c72e24c0c7 EditAsset: refactor common expression into its own variable. 2020-12-30 15:36:30 +01:00
Aaron van Geffen b8191bf554 EditAsset: handle case where suffix is null. 2020-12-30 15:36:27 +01:00
Aaron van Geffen 3594b3d021 Add BSD 3-clause license. 2020-12-30 13:55:30 +01:00
Aaron van Geffen 936d3d20db Add a readme file to the repo. 2020-12-30 13:55:16 +01:00
Aaron van Geffen 5c4a075231 Constrain aspect ratio conservation to image boundaries as well. 2020-12-30 13:26:31 +01:00
Aaron van Geffen 6ddf518294 Grow image and its container with document height. 2020-12-30 13:26:31 +01:00
Aaron van Geffen 66a411973a Constrain crop proportions by default, with checkbox to disable. 2020-12-30 13:26:31 +01:00
Aaron van Geffen a83b938f8a Reposition crop boundary when window resizes. 2020-12-30 13:26:31 +01:00
Aaron van Geffen 5344378333 Crop editor: interpret 'cs' as centre-sliced crop.
At some point, I started using 'cs' instead of 'cc'. Let's just support both.
2020-12-30 13:26:31 +01:00
Aaron van Geffen 8147e2b97d Crop editor: do not allow selections starting outside image bounds. 2020-12-30 13:26:31 +01:00
Aaron van Geffen d562c70667 Improve styling of form elements. 2020-12-30 13:06:44 +01:00
Aaron van Geffen 5599ff8d9b Crop editor: use numeric input boxes with appropriate constraints. 2020-12-30 13:05:23 +01:00
Aaron van Geffen e7490e40dd Clean up and force a rebuild of thumbnails when customising a crop region. 2020-12-30 13:05:23 +01:00