LycheeOrg / Lychee

A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.
https://lycheeorg.github.io/
MIT License
3.42k stars 303 forks source link

Thumbnail format in album incoherent with settings #1345

Closed gdureuil closed 2 years ago

gdureuil commented 2 years ago

Detailed description of the problem [REQUIRED]

I have selected "square" thumbnails in albums, but they show as "proportional justified". The setting also reverts itself automaticaly to "proportional justified" when I logout and login again.

Screenshots

image Setting for square thumbnails

image Not the usual square thumbnails

Output of the diagnostics [REQUIRED]

    Diagnostics
    -------
    Warning: Dropbox import not working. dropbox_key is empty.
    Warning: You may experience problems when uploading a photo of large size or handling many/large albums. Take a look in the FAQ for details.
    Warning: Default timezone not properly set; you might experience strange results when importing photos without explicit EXIF timezone

    System Information
    --------------
    Lychee Version (git):            master (68d60df) --  - Up to date (0 seconds ago).
    DB Version:                      4.5.1

    composer install:                dev
    APP_ENV:                         local
    APP_DEBUG:                       false

    System:                          Linux
    PHP Version:                     8.1
    PHP User agent:                  Lychee/4 (https://lycheeorg.github.io/)
    Timezone:                        UTC
    Max uploaded file size:          100M
    Max post size:                   100M
    Max execution time:              90
    MySQL Version:                   10.3.34-MariaDB-0+deb10u1-log

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

    Config Information
    --------------
    version:                         040501
    check_for_updates:               0
    sorting_photos_col:              title
    sorting_photos_order:            ASC
    sorting_albums_col:              title
    sorting_albums_order:            ASC
    imagick:                         1
    skip_duplicates:                 1
    small_max_width:                 0
    small_max_height:                360
    medium_max_width:                1920
    medium_max_height:               1080
    lang:                            fr
    layout:                          0
    image_overlay_type:              none
    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:                   
    landing_title:                   
    landing_subtitle:                
    landing_facebook:                
    landing_flickr:                  
    landing_twitter:                 
    landing_instagram:               
    landing_youtube:                 
    landing_background:              
    site_title:                      BakaGamer - Screenshots
    site_copyright_enable:           0
    site_copyright_begin:            2010
    site_copyright_end:              2022
    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:               0
    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:                      1
    location_decoding:               0
    location_decoding_timeout:       30
    location_show:                   0
    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:                    1
    nsfw_warning_admin:              0
    map_display_direction:           1
    album_subtitle_type:             oldstyle
    upload_processing_limit:         3
    public_photos_hidden:            1
    new_photos_notification:         0
    legacy_id_redirection:           1

Browser and system

Windows 11 Firefox 100.0.2 Edge 101.0.1210.53

ildyria commented 2 years ago

This line https://github.com/LycheeOrg/Lychee-front/blob/master/scripts/main/lychee.js#L331

lychee.layout = Number.parseInt(data.config.layout, 10) || 1;

Should be changed for the following:

lychee.layout = Number.parseInt(data.config.layout, 10);

As is, 0 is the square layout, which if seen as a number and or-ed with 1 will always return 1.

nagmat84 commented 2 years ago

A PR with a fix for the frontend has been approved and has been merged into the master branch of the frontend. The next time when a bigger PR to Lychee includes a sync with the frontend, the bug will be fixed.