owncloud/core

The thumbnail of the images does not display.

Xipro opened this issue · 7 comments

Xipro commented

The thumbnail of the images does not display.

Hello, recently I have been using a Arm operating system. During the process of compiling and installing OwnCloud, everything else is normal. The only problem is that after installing the MediaViewer application, the images do not display when opened, and the thumbnail of the images does not display. However, the video can be played normally. The following is the version information of the software I am using:

System
Release:
Kylin Linux Advanced Server release V10 (Lance)
Kernel:
4.19.90-52.22.v2207.ky10.aarch64
Build:
Kylin Linux Advanced Server
release V10 (SP3) /(Lance)-aarch64-Build23/20230324

Apache
Server version: Apache/2.4.43 (Unix)
Server built: Jan 29 2024 10:32:36

PHP
PHP 7.4.33 (cli) (built: Feb 12 2024 09:54:49) ( ZTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies

IMAGICK
imagick module => enabled
imagick module version => 3.7.0
imagick classes => Imagick, ImagickDraw, ImagickPixel, ImagickPixelIterator, ImagickKernel
Imagick compiled with ImageMagick version => ImageMagick 6.9.12-86 Q16 aarch64 17814 https://legacy.imagemagick.org
Imagick using ImageMagick library version => ImageMagick 6.9.12-86 Q16 aarch64 17814 https://legacy.imagemagick.org
ImageMagick copyright => (C) 1999 ImageMagick Studio LLC
ImageMagick release date => 2023-04-22
ImageMagick number of supported formats: => 245
ImageMagick supported formats => 3FR, 3G2, 3GP, AAI, AI, APNG, ART, ARW, AVI, AVS, BGR, BGRA, BGRO, BIE, BMP, BMP2, BMP3, BRF, CAL, CALS, CANVAS, CAPTION, CIN, CIP, CLIP, CMYK, CMYKA, CR2, CR3, CRW, CUR, CUT, DATA, DCM, DCR, DCX, DDS, DFONT, DNG, DOT, DPX, DXT1, DXT5, EPDF, EPI, EPS, EPS2, EPS3, EPSF, EPSI, EPT, EPT2, EPT3, ERF, EXR, FAX, FILE, FITS, FRACTAL, FTP, FTS, G3, G4, GIF, GIF87, GRADIENT, GRAY, GRAYA, GROUP4, GV, H, HALD, HDR, HISTOGRAM, HRZ, HTM, HTML, HTTP, HTTPS, ICB, ICO, ICON, IIQ, INFO, INLINE, IPL, ISOBRL, ISOBRL6, J2C, J2K, JBG, JBIG, JNG, JNX, JP2, JPC, JPE, JPEG, JPG, JPM, JPS, JPT, JSON, K25, KDC, LABEL, M2V, M4V, MAC, MAGICK, MAP, MASK, MAT, MATTE, MEF, MIFF, MKV, MNG, MONO, MOV, MP4, MPC, MPEG, MPG, MRW, MSL, MSVG, MTV, MVG, NEF, NRW, NULL, ORF, OTB, OTF, PAL, PALM, PAM, PANGO, PATTERN, PBM, PCD, PCDS, PCL, PCT, PCX, PDB, PDF, PDFA, PEF, PES, PFA, PFB, PFM, PGM, PGX, PICON, PICT, PIX, PJPEG, PLASMA, PNG, PNG00, PNG24, PNG32, PNG48, PNG64, PNG8, PNM, POCKETMOD, PPM, PREVIEW, PS, PS2, PS3, PSB, PSD, PTIF, PWP, RADIAL-GRADIENT, RAF, RAS, RAW, RGB, RGBA, RGBO, RGF, RLA, RLE, RMF, RW2, SCR, SCT, SFW, SGI, SHTML, SIX, SIXEL, SPARSE-COLOR, SR2, SRF, STEGANO, SUN, SVG, SVGZ, TEXT, TGA, THUMBNAIL, TIFF, TIFF64, TILE, TIM, TTC, TTF, TXT, UBRL, UBRL6, UIL, UYVY, VDA, VICAR, VID, VIDEO, VIFF, VIPS, VST, WBMP, WEBM, WEBP, WMF, WMV, WMZ, WPG, X, X3F, XBM, XC, XCF, XPM, XPS, XV, XWD, YCbCr, YCbCrA, YUV
Directive => Local Value => Master Value
imagick.locale_fix => 0 => 0
imagick.skip_version_check => 0 => 0
imagick.progress_monitor => 0 => 0
imagick.set_single_thread => 1 => 1
imagick.shutdown_sleep_count => 10 => 10
imagick.allow_zero_dimension_images => 0 => 0

The following is the debug error log:
"app":"webdav","method":"GET","url":"/remote.php/dav/files/*/Photos/Portugal.jpg?c=d02a9a5201e14d49277f3fb4e51e1ffa&x=1920&y=1920&a=1&preview=1","message":"Exception: HTTP/1.1 404 Not Found: {"Exception":"SabreDAVExceptionNotFound","Message":"","Code":0,"Trace":"#0 /home/owncloud/lib/composer/sabre/event/lib/WildcardEmitterTrait.php(89): OCADAVFilesPreviewPlugin->httpGet()n#1 /home/owncloud/lib/composer/sabre/dav/lib/DAV/Server.php(472): SabreDAVServer->emit()n#2 /home/owncloud/lib/composer/sabre/dav/lib/DAV/Server.php(253): SabreDAVServer->invokeMethod()n#3 /home/owncloud/apps/dav/lib/Server.php(348): SabreDAVServer->start()n#4 /home/owncloud/apps/dav/appinfo/v2/remote.php(31): OCADAVServer->exec()n#5 /home/owncloud/remote.php(165): require_once('/home/owncloud/...')n#6 {main}","File":"/home/owncloud/apps/dav/lib/Files/PreviewPlugin.php","Line":117}"

The following are the relevant error lines found based on the log PreviewPlugin. php, Line: 117 information:
$image = $fileNode->getThumbnail($queryParams)

How can I debug and find the cause of the error?
config_report_20240215.json

I think that you need an array of 'enabledPreviewProviders' in your config.php

https://github.com/owncloud/core/blob/master/config/config.sample.php#L1054

Xipro commented

@phil-davis I have tried your method, but it did not work. The problem now may be with my environment compilation. I want to use a separate test page that generates previews to test if there are any issues with my environment. When I use the Thumbnailimage function, I found that the environment is normal, but I have not yet found which function and method owncloud uses to generate image miniaturization.

Looks more like a support question / request rather then a bug report -> https://central.owncloud.org/c/server/54

Xipro commented

@iasdeoupxe @phil-davis
{"reqId":"ZdGFLFlDG5uQwSiZVVi3xAAAAME","level":0,"time":"2024-02-18T12:18:53+08:00","app":"OCUserSession::validateToken","method":"GET","url":"/remote.php/dav/files//Photos/Portugal.jpg?c=d02a9a5201e14d49277f3fb4e51e1ffa&x=32&y=32&forceIcon=0&preview=1","message":"token 215c75f5e3be3932f28922572f8d53f7550f450c4f5c970db6aea8311be6378432f524485369ebb736997db80e000e1b50de7ab4c102bc3fe4c750d34e1fddbb with token id 39 found, validating"}
{"reqId":"ZdGFLFlDG5uQwSiZVVi3xAAAAME","level":0,"time":"2024-02-18T12:18:53+08:00","app":"core","method":"GET","url":"/remote.php/dav/files/
/Photos/Portugal.jpg?c=d02a9a5201e14d49277f3fb4e51e1ffa&x=32&y=32&forceIcon=0&preview=1","message":"Generating preview for "//files/Photos/Portugal.jpg" with "OCPreviewJPEG""}
{"reqId":"ZdGFLFlDG5uQwSiZVVi3xAAAAME","level":0,"time":"2024-02-18T12:18:53+08:00","app":"core","method":"GET","url":"/remote.php/dav/files/
/Photos/Portugal.jpg?c=d02a9a5201e14d49277f3fb4e51e1ffa&x=32&y=32&forceIcon=0&preview=1","message":"OC_Image->loadFromFile, could not load"}
{"reqId":"ZdGFLFlDG5uQwSiZVVi3xAAAAME","level":0,"time":"2024-02-18T12:18:53+08:00","app":"core","method":"GET","url":"/remote.php/dav/files//Photos/Portugal.jpg?c=d02a9a5201e14d49277f3fb4e51e1ffa&x=32&y=32&forceIcon=0&preview=1","message":"OC_Image->fixOrientation() Orientation: -1"}
{"reqId":"ZdGFLK2MT2qIuXf5KhneVgAAAJE","level":0,"time":"2024-02-18T12:18:53+08:00","app":"OCUserSession::validateToken","method":"PROPFIND","url":"/remote.php/dav/files/
/Photos","message":"token 215c75f5e3be3932f28922572f8d53f7550f450c4f5c970db6aea8311be6378432f524485369ebb736997db80e000e1b50de7ab4c102bc3fe4c750d34e1fddbb with token id 39 found, validating"}
{"reqId":"ZdGFLFlDG5uQwSiZVVi3xAAAAME","level":0,"time":"2024-02-18T12:18:53+08:00","app":"webdav","method":"GET","url":"/remote.php/dav/files/*/Photos/Portugal.jpg?c=d02a9a5201e14d49277f3fb4e51e1ffa&x=32&y=32&forceIcon=0&preview=1","message":"Exception: HTTP/1.1 404 Not Found: {"Exception":"SabreDAVExceptionNotFound","Message":"","Code":0,"Trace":"#0 /home/owncloud/lib/composer/sabre/event/lib/WildcardEmitterTrait.php(89): OCADAVFilesPreviewPlugin->httpGet()
#1 /home/owncloud/lib/composer/sabre/dav/lib/DAV/Server.php(472): SabreDAVServer->emit()
#2 /home/owncloud/lib/composer/sabre/dav/lib/DAV/Server.php(253): SabreDAVServer->invokeMethod()
#3 /home/owncloud/apps/dav/lib/Server.php(348): SabreDAVServer->start()
#4 /home/owncloud/apps/dav/appinfo/v2/remote.php(31): OCADAVServer->exec()
#5 /home/owncloud/remote.php(165): require_once('/home/owncloud/...')
#6 {main}","File":"/home/owncloud/apps/dav/lib/Files/PreviewPlugin.php","Line":117}"}

After further investigation, I found that there was an issue with the generation of the preview file for the image. The file was not generated in the file thumbnail folder, and the error message above was reported in the log.

Xipro commented

After several days of testing, it was found that only JPG format images cannot generate miniature images, while PNG and BMP formats have no issues.

jpg works also, see https://demo.owncloud.org/apps/files/?dir=/Photos&fileid=9 (login via demo:demo).

Demo runs on 10.13.4 but you refrained from providing the ownCloud version on your system so this could make a difference. Otherwise probably environmental problems could be also responsible (Bugs in PHP, ImageMagick, ... of the environment).

Xipro commented

@iasdeoupxe After a few days of debugging, I have found that the problem is probably in the Generating preview for "/* */files/Photos/Portugal. jpg" with "OC \ Preview \ JPEG" stage. This is because PNG format can generate and store thumbnails normally, but JPG format images cannot be generated, so there may be loading issues in the subsequent loading process. Is there any way for me to debug the generation of microfiles separately, similar to the getThumbnail function.