Age | Commit message (Collapse) | Author |
|
- Added missing_album_cover.jpg placeholder image.
- Modified the graphics helper to use it. Calling graphics::generate will copy it.
- Modified item::remove_album_cover and gallery_event::item_created to run graphics::generate.
- Added unit test to Graphics_Helper_Test.
|
|
Restrict which album cover ids we swap over to the hierarchy of the
current album, otherwise we can wind up in sticky situations with
hierarchical album cover chains.
Eg, you have a hierarchy like this:
root -> A1 -> A2 --> A3 -> P1
A4 -> P2
P1 is the album cover for its entire hierarchy. But then you
swap A2's album cover for A3 making this:
root -> A1 -> A2 + A3 -> P1
\-> A4 -> P2
Since A1, A2 and A3 all had P1 as their album cover item id. Now
we're swapping it over to P2 but we want to leave P1 as A3's album
cover item id. So only look at A4's hierarchy and ignore its peers.
|
|
|
|
album cover. Fixes #1979.
|
|
using the old item as their album cover. Fixes #1978.
|
|
#1968 - Improve album cover generation/removal/etc.
|
|
Create a siblings() function which pulls together the siblings_callback
function and makes it a more palatable API.
|
|
|
|
containing a callback that returns all the siblings. Fixes #1975.
|
|
- Added stanza to Item_Model::save that handles when cover id is null.
- Added logic to graphics::generate to copy/convert album cover thumbs from their item thumbs to ensure they're always jpg, and eliminate the possibility that we copy/convert a dirty thumb.
- Redirected other places in code where we want to do one of the above two things to use these two functions instead (gallery_event::item_updated_data_file, item::make_album_cover, item::remove_album_cover).
- Improved validation in Item_Model so only albums can have covers and all covers must be non-albums.
- Added unit tests to Graphics_Helper_Test.
|
|
- Made missing_photo match the image format (jpg, png, etc.).
- Swapped missing_photo.png for missing_photo.jpg since it's likely to require less conversion to match.
- Improved error messages to user when things go wrong.
- Ensured that missing image placeholders are always copied when there's an error.
- Ensured we don't mistake no file output for a correct file output (delete target before attempt).
- Restructured graphics::generate a bit to work better with above changes.
- Added unit tests for graphics::generate.
|
|
#1945 - Extend legal_file helper functions.
|
|
#1969 - Give graphics events the ability to override the standard process
|
|
- Added get_types_by_extension function, which is a merged version of get...types_by_extension functions (similar to get_extensions).
- Added optional extension argument to get...extensions functions similar to get...types_by_extension functions.
- Added unit tests. Now, every legal_file function has one.
- Restructured helper file to include caches.
- Added array_unique to get...types (derived from get...types_by_extension, which can be many-to-one).
- Edited server_add, uploader, and item model to use new functionality.
|
|
- Set the sort_column of the parent album to id, which has no possibility of being identical between the two photos.
- Now, the reweighting will reverse the order even if they were created during the same second.
|
|
While graphics_rotate, graphics_resize, and graphics_composite events already exist, they don't have the ability to *override* the standard process.
This makes it a bit tricky when you want to replace the standard procedure with another (e.g. use jpegtran to perform lossless jpg rotation).
Solution:
- make a temp filename.
- tell the events to use it as the output file.
- if an event makes something, use it and skip the standard process.
|
|
on installs
that use File_Proxy heavily. Fixes #1920.
|
|
#1966 - "Fix your Gallery" shows 60/59 items completed.
|
|
- Fixed counter in gallery_task::fix that was often one too many.
For FIX_STATE_RUN_MISSING_ACCESS_CACHES, changed this:
$stack = explode(" ", $task->get("stack"));
To this:
$stack = array_filter(explode(" ", $task->get("stack")));
|
|
conflict-finding code check filenames with no extensions
- Reduced from four places that alter names/slugs to two (one to populate empty slugs, one to handle conflicting names/slugs).
- For empty slugs, fill with generic human-readable name (e.g. "photo") instead of random value.
- For conflicting names/slugs, add suffix that's sequential (e.g. "-01"), only using random after 99 conflicts.
- Made conflict-finding code check filenames with no extensions.
- Renamed _randomize_name_or_slug_on_conflict to _check_and_fix_conflicts.
- Added unit tests. Also cleaned up existing unit tests to reflect new logic and removed a redundant test.
- Added installer logic to correct existing items now considered in conflict.
- Revised gallery_task to look for duplicate names based on new criteria.
|
|
#1965 - Improve sanity checks and copy/convert/process logic for rotate and resize
|
|
- added photo_get_file_metadata and movie_get_file_metadata events
- modified photo::get_file_metadata and movie::get_file_metadata to use them
- ensure that non-readable files throw exceptions
- redirected other photo metadata calls in core to photo::get_file_metadata (the helper function already exists, but in many places getimagesize is still called directly)
- added some unit tests (neither of the functions above had one)
|
|
resize.
- resize: ensured that resize is skipped *only* if the metadata is valid or the options are well-defined and would upscale. Then, if resize is skipped, check to see if it still needs to be converted. Previous conditions would allow a small PNG to get copied to a JPG, and would allow a corrupted JPG to be copied to the output.
- rotate: add checks for empty file or empty options.
- use get_file_metadata instead of direct getimagesize call.
- add unit tests for rotate and resize, including some for corrupted input files and missing options.
|
|
In MySQL queries, _ and % characters are treated as wildcards (similar to ? and *, respectively).
- Added escape_for_like function to MY_Database.php
- Added unit test to Database_Test
- Corrected the five unescaped instances in the code using this function.
|
|
value for lock_timeout so that folks who get the latest code but don't
run the upgrader don't get burned by a SQL error.
|
|
|
|
images so that we can see how efficient our proxying is. Follow-on
for #1959.
|
|
#1955 - Make unit test photos unique.
|
|
- Added test::random_unique_photo and test::random_unique_photo_unsaved to uniquify test photos.
- Uniquified the black dot of test.jpg by coloring it with the six-digit hex code already used to name the random photos (e.g. "name_a48801.jpg").
- Modified four tests in Item_Model_Test that check photo file contents to use new functions to guarantee uniqueness.
|
|
- Added no_extra_spaces_at_end_of_line_test to File_Structure_Test.
- Updated Gallery_Filters to exclude testing code that isn't ours.
- Removed existing extra spaces. New test now passes.
|
|
item::reweight_all_children as an API and write a test for it. Work
in progress on #1914.
|
|
data_rest responses, and check cache validity. Fixes #1909.
|
|
"_test" and
fixing it in 9ba9f3953132c5c5de9efb0a4724c7b9300dc9ea I decided to write a test to make
sure that we don't have any other overlooked tests. We don't.
|
|
|
|
|
|
array
representation of Item_Model. Fixes #1903.
|
|
provides a quick/easy way for server admins to provide profile output.
Fixes #1959.
|
|
children. Fixes #1958.
|
|
#1954 - Skip buffer calls for unit tests of file_proxy and data_rest.
|
|
codex.gallery2.org -> codex.galleryproject.org
Fixes #1957.
|
|
Moved the "if (TEST_MODE)" statement before the buffer calls in file_proxy and data_rest.
This has no impact on normal use, but will make the unit tests more compatible with different server/PHP configurations.
Note: We do not have to skip setting the headers, which means we can build unit tests around them if we wish.
|
|
|
|
#1950 - Replace bogus file overwrites from item model unit test.
|
|
clause that returns nothing when the album has no album cover - we'll
fail before that if the album's thumbnail is missing, and if it's not
missing then we'll have something to serve even if it's out of date.
|
|
edge case behaviors. It doesn't cover the various headers, but it does cover
the permission based code paths.
|
|
- modified rename_photo_test, rename_album_test, move_album_test, move_photo_test
- unit tests still test file system integrity and pass
|
|
Correct result: always "image/jpeg"
Old data_rest result: mime of cover item
Old file_proxy result: mime of album item (null)
|
|
#1942 - Make data_rest and file_proxy more consistent
|
|
#1941, 1948 - Fix possible warnings in movie and graphics helpers, add functions to convert between seconds and hh:mm:ss.dd (and their unit tests).
|
|
get_movie_types_by_extension_test.
|