viewer icon indicating copy to clipboard operation
viewer copied to clipboard

RAW photos are not displayed with infinite spinner

Open andreybavt opened this issue 2 years ago • 19 comments

Describe the bug When opening a RAW photo from "Files" menu there's an infinite spinner instead of preview. When navigating back/forward and back the photo preview loads fine

Camera raw previews app is installed and thumbnails appear fine.

Tested with NEF files, for example: https://github.com/ariselseng/camerarawpreviews/files/9942647/infrared.nef.zip

There's no problem with JPGs, they can be opened directly

To Reproduce Steps to reproduce the behavior:

  1. Go to Files -> Raw photo location
  2. Click on a photo thumbnail
  3. See infinite spinner

Expected behavior Photo preview opens

Screenshots image image

Desktop (please complete the following information):

  • OS: MacOS 12.6
  • Browser chrome
  • Version 107.0.5304.87

Additional context This issue is also reported in the camerarawpreviews repo: https://github.com/ariselseng/camerarawpreviews/issues/86

But it doesn't seem to be a camerarawpreviews problem because with back-forward navigation the preview does appear

andreybavt avatar Nov 07 '22 19:11 andreybavt

As I already wrote in https://github.com/ariselseng/camerarawpreviews/issues/86, v24.0.3 is the last known-good version. All later versions of the v24 branch are affected. I assume that this commit is the culprit: https://github.com/nextcloud/viewer/commit/e2c48013628cf19c2519cb2c7efb96014dcdb591

jkhsjdhjs avatar Nov 07 '22 19:11 jkhsjdhjs

Hello! I will need your browser console log to investigate this issue. Open your console, reload your page and/or do the action leading to this issue and copy/paste the log in this thread.

How to access your browser console (Click to expand)

Chrome

  • Press either CTRL + SHIFT + J to open the “console” tab of the Developer Tools.
  • Alternative method:
    1. Press either CTRL + SHIFT + I or F12 to open the Developer Tools.
    2. Click the “console” tab.

Safari

  • Press CMD + ALT + I to open the Web Inspector.
  • See Chrome’s step 2. (Chrome and Safari have pretty much identical dev tools.)

IE9

  1. Press F12 to open the developer tools.
  2. Click the “console” tab.

Firefox

  • Press CTRL + SHIFT + K to open the Web console (COMMAND + SHIFT + K on Macs).
  • or, if Firebug is installed (recommended):
    1. Press F12 to open Firebug.
    2. Click on the “console” tab.

Opera

  1. Press CTRL + SHIFT + I to open Dragonfly.
  2. Click on the “console” tab.

skjnldsv avatar Nov 08 '22 15:11 skjnldsv

at the bottom of hundreds of deprecation warnings is the action of clicking on a raw photo for a preview on Windows 11 - Chrome 107.0.5304.88 nextcloud.domain.tld-1667934344266.log

D34DC3N73R avatar Nov 08 '22 20:11 D34DC3N73R

@skjnldsv

as @D34DC3N73R said there's a ton of

The global jQuery is deprecated. It will be removed in a later versions without another warning. Please ship your own.

I filtered them out, here's what's left in the console log:

192.168.10.120/:1 Refused to apply style from 'https://192.168.10.120:8283/apps/contacts/css/icons.css?v=19bbdecf-0' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
index.es.js:2337 Proxying an event bus of version 2.1.1 with 1.3.0
jquery-migrate.min.js:2 JQMIGRATE: Migrate is installed, version 3.4.0
index.es.js:2337 Proxying an event bus of version 2.1.1 with 1.3.0
index.es.js:2337 Proxying an event bus of version 2.1.1 with 1.3.0
index.es.js:2337 Proxying an event bus of version 2.1.1 with 1.3.0
index.es.js:2337 Proxying an event bus of version 2.1.1 with 1.3.0
major.js:2 Proxying an event bus of version 2.1.1 with 1.3.0
index.js:19 Proxying an event bus of version 2.1.1 with 3.0.0
index.esm.js:11 Proxying an event bus of version 2.1.1 with 3.0.2
index.esm.js:11 Proxying an event bus of version 2.1.1 with 3.0.2
index.es.js:2337 Proxying an event bus of version 2.1.1 with 1.3.0
index.js:19 Proxying an event bus of version 2.1.1 with 3.0.2
ProxyBus.ts:16 Proxying an event bus of version 2.1.1 with 3.0.2
ProxyBus.ts:16 Proxying an event bus of version 2.1.1 with 3.0.2
index.es.js:2337 Proxying an event bus of version 2.1.1 with 1.3.0
index.js:19 Proxying an event bus of version 2.1.1 with 3.0.0
ProxyBus.js:74 Proxying an event bus of version 2.1.1 with 1.2.0
ProxyBus.ts:11 Proxying an event bus of version 2.1.1 with 3.0.2
index.es.js:2337 Proxying an event bus of version 2.1.1 with 1.3.0
ConsoleLogger.js:60 [WARN] viewer: Some mimes were ignored because they are not enabled in the server previews config {level: 2, app: 'viewer', uid: 'ncadmin', ignoredMimes: Array(1)}
index.esm.js:11 Proxying an event bus of version 2.1.1 with 3.0.2
index.js:19 Proxying an event bus of version 2.1.1 with 3.0.2
index.js:19 Proxying an event bus of version 2.1.1 with 3.0.2
index.esm.js:11 Proxying an event bus of version 2.1.1 with 3.0.2
index.js:19 Proxying an event bus of version 2.1.1 with 3.0.2
index.es.js:2337 Proxying an event bus of version 2.1.1 with 1.3.0
ProxyBus.ts:16 Proxying an event bus of version 2.1.1 with 3.0.2
ProxyBus.ts:16 Proxying an event bus of version 2.1.1 with 3.0.2
index.es.js:2337 Proxying an event bus of version 2.1.1 with 1.3.0
NotificationsApp.vue:461 Notifications permissions not yet requested
index.es.js:2337 Proxying an event bus of version 2.1.1 with 1.3.0
index.js:19 Proxying an event bus of version 2.1.1 with 3.0.0
session-heartbeat.js:103 session heartbeat polling started
index.js:19 Proxying an event bus of version 2.1.1 with 3.0.2
xhr.js:220          GET https://192.168.10.120:8283/ocs/v2.php/apps/text/workspace?path=%2FPhotos 404

I find it weird that there's this message:

ConsoleLogger.js:60 [WARN] viewer: Some mimes were ignored because they are not enabled in the server previews config {level: 2, app: 'viewer', uid: 'ncadmin', ignoredMimes: Array(1)}

the ignoredMimes contains ['image/tiff'] which is weird because this is what I have in my /usr/local/www/nextcloud/apps/photos/lib/AppInfo/Application.php:

image

andreybavt avatar Nov 08 '22 22:11 andreybavt

I don't have image/tiff in the array (default install). However, since the image previews do in fact load when pressing next/previous, I'm not sure that's the root cause of this issue.

D34DC3N73R avatar Nov 09 '22 00:11 D34DC3N73R

the ignoredMimes contains ['image/tiff'] which is weird because this is what I have in my /usr/local/www/nextcloud/apps/photos/lib/AppInfo/Application.php:

It means your previews config is not including tiff. https://github.com/nextcloud/server/blob/0dabc6abc6fe203b5126a6f4fc33ddb55cfd41ea/config/config.sample.php#L1202-L1247 https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html

skjnldsv avatar Nov 09 '22 08:11 skjnldsv

the ignoredMimes contains ['image/tiff'] which is weird because this is what I have in my /usr/local/www/nextcloud/apps/photos/lib/AppInfo/Application.php:

You should not edit php files. You will actually break Viewer if you add custom mimes there.

skjnldsv avatar Nov 09 '22 08:11 skjnldsv

I filtered them out, here's what's left in the console log:

Did you pen a raw file? Open the console, then try to open the raw file so we can see the viewer logs. Please make sure you also have verbose enabled in the console filters (same location where you filtered out warnings. image

skjnldsv avatar Nov 09 '22 08:11 skjnldsv

at the bottom of hundreds of deprecation warnings is the action of clicking on a raw photo for a preview on Windows 11 - Chrome 107.0.5304.88 nextcloud.domain.tld-1667934344266.log

It seems you're indeed opening the file, but there is no errors. ConsoleLogger.js:33 [INFO] viewer: Opening viewer for file {app: 'viewer', uid: 'admin_user', path: '/path/where/raw/files/are/DSC00687.ARW'}, app: "viewer", path: "/path/where/raw/files/are/DSC00687.ARW"

I will need a screenshot of your network requests. Before you do anything, still on the development tools, there is a tab called network. Click on it, do your action and screenshot the network log like this. Do not select any filters, leave it on all, make sure to scroll to the bottom before the screenshot capture d ecran_2018-09-27_21-49-46

skjnldsv avatar Nov 09 '22 08:11 skjnldsv

And thank you all for helping narrowing this down :)

skjnldsv avatar Nov 09 '22 08:11 skjnldsv

the ignoredMimes contains ['image/tiff'] which is weird because this is what I have in my /usr/local/www/nextcloud/apps/photos/lib/AppInfo/Application.php:

You should not edit php files. You will actually break Viewer if you add custom mimes there.

I was trying different combinations in Application.php in order to make NEFs appear in Photos app, in the end applying this change (mentioned in this discussion) helped: https://github.com/nextcloud/photos/pull/844/files

andreybavt avatar Nov 09 '22 08:11 andreybavt

@skjnldsv thanks for investigating!

Here's what I have when opening this URL: /apps/files/?dir=/NEF&openfile=32475

image

here's a full console log with Verbose level on: 192.168.10.120-1667984035958.log

... and with some filtering: image

andreybavt avatar Nov 09 '22 08:11 andreybavt

Weird, it fetched the preview and it seems the request completed properly! :thinking: image

skjnldsv avatar Nov 09 '22 09:11 skjnldsv

indeed, the preview that it feched also has a correct size, so it's not just a thumbnail: image

I don't know if you tried to reproduce it, but normally with the demo infrared.nef file that I attached in the beginning you should be able to do it

andreybavt avatar Nov 09 '22 09:11 andreybavt

I can reproduce, I'm investigating. Thank you all!

skjnldsv avatar Nov 09 '22 09:11 skjnldsv

https://github.com/nextcloud/viewer/pull/1273 broke it

skjnldsv avatar Nov 09 '22 10:11 skjnldsv

If anyone know how to manually patch their instance, feel free to try https://github.com/nextcloud/viewer/pull/1456

skjnldsv avatar Nov 09 '22 10:11 skjnldsv

Are there any updates on when this will make it into a release/beta? It's been an issue for a while now, happy to help out with testing if needed. The patch worked for me on 26 but upon updating to 27 it's broken again.

dan-r avatar May 24 '23 08:05 dan-r

@skjnldsv Is there anything I can do to fix my app with Viewer? Some years ago you helped set this up: https://github.com/ariselseng/camerarawpreviews/blob/master/js/register-viewer.js Is this correct use of the registerHandler API?

ariselseng avatar Aug 28 '23 20:08 ariselseng