Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading an image makes an album inaccessible & undeletable #925

Closed
mataebi opened this issue Feb 14, 2021 · 6 comments · Fixed by #926
Closed

Uploading an image makes an album inaccessible & undeletable #925

mataebi opened this issue Feb 14, 2021 · 6 comments · Fixed by #926
Labels
bug Something isn't working

Comments

@mataebi
Copy link

mataebi commented Feb 14, 2021

Detailed description of the problem

There seems to be the possibility to upload a specific image to Lychee which entirely blocks an album and all of its contents, i.e. when trying got open the album after the upload of this image the system just displays an error (Error: Server error or API not found). The same happens if you try to «Delete» the album containing this image. This leaves you with an album that cannot be used or removed anymore.

Open Album Error

This happens independently of the way the image is imported to the system: «Drag & Drop» or «Import from Server». The zipped version of an example image triggering this problem has been attached to this ticket.

It looks like the original image is properly copied to the «big» folder and the «thumb» image is created afterwards. However the «small» version of the image does not seem to be created.

Steps to reproduce the issue

  1. Create a new album
  2. Download and unzip the image attached to this ticket
  3. Upload the image into the new album
  4. Try to open the album -> error
  5. Try to remove the album -> error

Logfile

2021-02-14 20:04:23 -- notice  -- App\Actions\Photo\Extensions\ImageEditing::resizePhoto -- 131 -- No resize (image is too small: 0x720)!
2021-02-14 20:04:23 -- notice  -- App\Actions\Photo\Extensions\ImageEditing::resizePhoto -- 131 -- No resize (image is too small: 0x360)!
2021-02-14 20:04:23 -- notice  -- App\Actions\Photo\Extensions\ImageEditing::resizePhoto -- 131 -- No resize (image is too small: 3840x2160)!
2021-02-14 20:04:23 -- notice  -- App\Actions\Photo\Extensions\ImageEditing::resizePhoto -- 131 -- No resize (image is too small: 1920x1080)!
2021-02-14 20:04:23 -- notice  -- App\Image\ImagickHandler::crop -- 161 -- Saving thumb to /var/www/html/public/uploads/thumb/032030b502a4629b91b9e86392a01194.jpeg
2021-02-14 20:04:23 -- notice  -- App\Actions\Photo\Extensions\ImageEditing::createThumb -- 158 -- Photo URL is 032030b502a4629b91b9e86392a01194
2021-02-14 20:03:21 -- notice  -- App\ModelFunctions\SessionFunctions::log_as_admin -- 176 -- User (maebi) has logged in from 10.0.1.19

Output of the diagnostics

Diagnostics
-------
Warning: Dropbox import not working. dropbox_key is empty.

System Information
--------------
Lychee Version (release):        4.2.1
DB Version:                      4.2.1

composer install:                --no-dev
APP_ENV:                         production
APP_DEBUG:                       false

System:                          Linux
PHP Version:                     7.4
Max uploaded file size:          500M
Max post size:                   500M
MySQL Version:                   10.5.8-MariaDB-1:10.5.8+maria~focal

Imagick:                         1
Imagick Active:                  1
Imagick Version:                 1690
GD Version:                      2.2.5

Config Information
--------------
version:                         040201
check_for_updates:               0
sorting_Photos_col:              takestamp
sorting_Photos_order:            ASC
sorting_Albums_col:              max_takestamp
sorting_Albums_order:            ASC
imagick:                         1
skip_duplicates:                 0
small_max_width:                 0
small_max_height:                360
medium_max_width:                1920
medium_max_height:               1080
lang:                            en
layout:                          1
image_overlay:                   1
image_overlay_type:              desc
default_license:                 none
compression_quality:             90
full_photo:                      1
delete_imported:                 0
Mod_Frame:                       1
Mod_Frame_refresh:               30
thumb_2x:                        1
small_2x:                        1
medium_2x:                       1
landing_page_enable:             0
landing_owner:                   John Smith
landing_title:                   John Smith
landing_subtitle:                Cats, Dogs & Humans Photography
landing_facebook:                https://www.facebook.com/JohnSmith
landing_flickr:                  https://www.flickr.com/JohnSmith
landing_twitter:                 https://www.twitter.com/JohnSmith
landing_instagram:               https://instagram.com/JohnSmith
landing_youtube:                 https://www.youtube.com/JohnSmith
landing_background:              dist/cat.jpg
site_title:                      Lychee v4
site_copyright_enable:           0
site_copyright_begin:            2019
site_copyright_end:              2019
additional_footer_text:          
display_social_in_gallery:       0
public_search:                   0
SL_enable:                       0
SL_for_admin:                    0
public_recent:                   0
recent_age:                      1
public_starred:                  0
downloadable:                    0
photos_wraparound:               1
map_display:                     0
zip64:                           1
map_display_public:              0
map_provider:                    Wikimedia
force_32bit_ids:                 0
map_include_subalbums:           0
update_check_every_days:         3
has_exiftool:                    0
share_button_visible:            0
import_via_symlink:              0
has_ffmpeg:                      0
location_decoding:               0
location_decoding_timeout:       30
location_show:                   1
location_show_public:            0
rss_enable:                      0
rss_recent_days:                 7
rss_max_items:                   100
prefer_available_xmp_metadata:   0
editor_enabled:                  1
lossless_optimization:           0
swipe_tolerance_x:               150
swipe_tolerance_y:               250
local_takestamp_video_formats:   .avi|.mov
log_max_num_line:                1000
unlock_password_photos_with_url_param: 0
nsfw_visible:                    1
nsfw_blur:                       0
nsfw_warning:                    0
nsfw_warning_admin:              0

Browser and system

OS X 10.14.6
Firefox 85.0.1

@kamil4 kamil4 mentioned this issue Feb 15, 2021
@kamil4 kamil4 added the bug Something isn't working label Feb 15, 2021
@kamil4
Copy link
Contributor

kamil4 commented Feb 15, 2021

The small variant is not created simply because of low resolution of the original image. That's not the source of your problems.

It's a little embarrassing but Lychee is failing because... the file name doesn't have any extension. Our code currently assumes that an extension is always present so it fails in weird ways with files like yours.

I just started fixing this in #926. I don't consider the fix to be complete yet but it is enough to enable the album to be opened and the photo to be deleted. If you want to try it out, simply replace the files app/Assets/Helpers.php and app/Models/Photo.php in your install with the ones from that PR (the fix in app/Actions/Photo/Extensions/ImageEditing.php is only relevant during upload/import).

@mataebi
Copy link
Author

mataebi commented Feb 15, 2021

Thank you very much for this immediate reaction and the explication which will help me to avoid the problem in my upload scripts. I'm sorry I didn't figure out / report the actual reason for the problem. I'll install the new code as soon as I can to give you a quick feedback.

Let me tell you at this point how much I appreciate your work and that of the other team members. I did a lot of research and comparison before deciding to use Lychee to store and share my photos. Great work!

@mataebi
Copy link
Author

mataebi commented Feb 15, 2021

The fixes found in #926 do the job and images without an extension now work as expected.

@mataebi mataebi closed this as completed Feb 15, 2021
@ildyria
Copy link
Member

ildyria commented Feb 15, 2021

As long as #926 is not merged, this should not be closed. :)

@ildyria ildyria reopened this Feb 15, 2021
@mataebi
Copy link
Author

mataebi commented Feb 15, 2021

Ok, sorry for being too fast, Will this be closed by the team creating the next release or should I check it once the patches have been integrated / released.

@ildyria
Copy link
Member

ildyria commented Feb 15, 2021

Ok, sorry for being too fast, Will this be closed by the team creating the next release or should I check it once the patches have been integrated / released.

No worries, we do appreciate that you close the issue yourself, that is very kind of you.

Even better, GitHub will auto-close the issue when #926 is merged: the PR description contains "Fixes #925".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants