nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
26.68k stars 4k forks source link

ImagickException Failed to read the file #47289

Open AndyXheli opened 4 weeks ago

AndyXheli commented 4 weeks ago

NC 30 RC1 Not running docker Ubuntu 22.04 PHP 8.3 Redis Apache2 imagemagick is already the newest version (8:6.9.11.60+dfsg-1.3ubuntu0.22.04.5+esm1). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

{"reqId":"n5ZKVfuUurXDFGb6OnQF","level":3,"time":"2024-08-16T08:33:14-05:00","remoteAddr":"","user":"","app":"core","method":"GET","url":"/core/preview?fileId=1575189&x=250&y=250","message":"File: /username/files/Photos/2024/24-08-14 21-58-05 0598.heic Imagick says:","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36","version":"30.0.0.8","exception":{"Exception":"ImagickException","Message":"Failed to read the file","Code":1,"Trace":[{"file":"/var/www/nextcloud/lib/private/Preview/HEIC.php","line":99,"function":"pingImage","class":"Imagick","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/HEIC.php","line":56,"function":"getResizedPreview","class":"OC\\Preview\\HEIC","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/GeneratorHelper.php","line":44,"function":"getThumbnail","class":"OC\\Preview\\HEIC","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":337,"function":"getThumbnail","class":"OC\\Preview\\GeneratorHelper","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":313,"function":"generateProviderPreview","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":119,"function":"getMaxPreview","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/Preview/Generator.php","line":86,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/lib/private/PreviewManager.php","line":167,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->"},{"file":"/var/www/nextcloud/core/Controller/PreviewController.php","line":159,"function":"getPreview","class":"OC\\PreviewManager","type":"->"},{"file":"/var/www/nextcloud/core/Controller/PreviewController.php","line":123,"function":"fetchPreview","class":"OC\\Core\\Controller\\PreviewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":208,"function":"getPreviewByFileId","class":"OC\\Core\\Controller\\PreviewController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":996,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Preview/HEIC.php","Line":99,"message":"File: /username/files/Photos/2024/24-08-14 21-58-05 0598.heic Imagick says:","exception":[],"CustomMessage":"File: /username/files/Photos/2024/24-08-14 21-58-05 0598.heic Imagick says:"},"id":"66bf552f2e150"}

image

Also nothing change on my system only nextcloud update so why are we getting this all of a sudden never had issue with HEIC photos before

when i open the photo image

image

AndyXheli commented 4 weeks ago

I’ve observed that on my iPhone running iOS 18 with the Nextcloud client version 5.5.4.13, having "Most Compatible" turned off and Live Photos enabled causes errors when uploading photos. However, when "Most Compatible" is turned on, everything works fine, and the photos are saved as JPEGs.

I also tested the same setup on my iPad, which isn’t on iOS 18, and with "Most Compatible" off, it works correctly. I’m wondering if iOS 18 has introduced changes to the HEIC format that are causing issues with Nextcloud uploads.

hbprotoss commented 3 weeks ago

similar situation here

NC 29 inside docker

photos uploaded by iOS 18 device, with "Most Compatible" turned off and Live Photos enabled

log reports

{"reqId":"IKURbZenu8VQKrMEBbxX","level":3,"time":"2024-08-20T07:37:35+00:00","remoteAddr":"220.189.193.180","user":"xxx","app":"core","method":"GET","url":"/apps/memories/api/image/preview/105406?c=7918f025dc0bde9b91f4633cfea852a6&x=3360&y=2100&a=1","message":"File: /xxx/files/Photos/IMG_1200.HEIC Imagick says:","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36","version":"29.0.4.1","exception":{"Exception":"ImagickException","Message":"Failed to read the file","Code":1,"Trace":[{"file":"/var/www/html/lib/private/Preview/HEIC.php","line":119,"function":"pingImage","class":"Imagick","type":"->","args":["/var/www/html/data/xxx/files/Photos/IMG_1200.HEIC[0]"]},{"file":"/var/www/html/lib/private/Preview/HEIC.php","line":76,"function":"getResizedPreview","class":"OC\\Preview\\HEIC","type":"->","args":["/var/www/html/data/xxx/files/Photos/IMG_1200.HEIC",4096,4096]},{"file":"/var/www/html/lib/private/Preview/GeneratorHelper.php","line":64,"function":"getThumbnail","class":"OC\\Preview\\HEIC","type":"->","args":[["OC\\Files\\Node\\File"],4096,4096]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":361,"function":"getThumbnail","class":"OC\\Preview\\GeneratorHelper","type":"->","args":[["OC\\Preview\\HEIC"],["OC\\Files\\Node\\File"],4096,4096]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":337,"function":"generateProviderPreview","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\SimpleFS\\SimpleFolder"],["OC\\Files\\Node\\File"],4096,4096,false,true,"image/heic",""]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":143,"function":"getMaxPreview","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\SimpleFS\\SimpleFolder"],[],["OC\\Files\\Node\\File"],"image/heic",""]},{"file":"/var/www/html/lib/private/Preview/Generator.php","line":110,"function":"generatePreviews","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\Node\\File"],[[3360,2100,false,"fill"]],"image/heic"]},{"file":"/var/www/html/lib/private/PreviewManager.php","line":190,"function":"getPreview","class":"OC\\Preview\\Generator","type":"->","args":[["OC\\Files\\Node\\File"],3360,2100,false,"fill",null]},{"file":"/var/www/html/custom_apps/memories/lib/Controller/ImageController.php","line":62,"function":"getPreview","class":"OC\\PreviewManager","type":"->","args":[["OC\\Files\\Node\\File"],3360,2100,false,"fill"]},{"file":"/var/www/html/custom_apps/memories/lib/UtilController.php","line":20,"function":"OCA\\Memories\\Controller\\{closure}","class":"OCA\\Memories\\Controller\\ImageController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/custom_apps/memories/lib/Controller/ImageController.php","line":55,"function":"guardEx","class":"OCA\\Memories\\Util","type":"::","args":[["Closure"]]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":232,"function":"preview","class":"OCA\\Memories\\Controller\\ImageController","type":"->","args":[105406,3360,2100,true,"fill"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":138,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Memories\\Controller\\ImageController"],"preview"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":184,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[["OCA\\Memories\\Controller\\ImageController"],"preview"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":338,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Memories\\Controller\\ImageController","preview",["OC\\AppFramework\\DependencyInjection\\DIContainer"],["105406","memories.image.preview"]]},{"file":"/var/www/html/lib/base.php","line":1050,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/memories/api/image/preview/105406"]},{"file":"/var/www/html/index.php","line":49,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Preview/HEIC.php","Line":119,"message":"File: /xxx/files/Photos/IMG_1200.HEIC Imagick says:","exception":{},"CustomMessage":"File: /xxx/files/Photos/IMG_1200.HEIC Imagick says:"}}
AndyXheli commented 3 weeks ago

@hbprotoss i think is has to do with someone on ios18 and nextcloud iOS client. But let's see what happens! The iOS team can explain what's going on

hbprotoss commented 3 weeks ago

@hbprotoss i think is has to do with someone on ios18 and nextcloud iOS client. But let's see what happens! The iOS team can explain what's going on

the underlining lib has fixed the issue, hope nextcloud to update dep

https://github.com/strukturag/libheif/releases/tag/v1.18.0

edm00se commented 3 weeks ago

I had (attempted to) report this issue in nextcloud/previewgenerator#504, this appears to be the case for every heic photo (not screenshot or video) I've taken since moving up to the iOS 18 public beta. The link to the libheif is what I'd found as the most likely culprit as well.

I did not upload the images with the NC iOS app, so I doubt that's part of the issue.

pavlohav commented 1 week ago

Looks like I am also running into this exact issue. Also running IOS 18.1 beta and am not able to view those HEIC photos in nextcloud. Running NC AIO 9.4.1