nextcloud / photos

📸 Your memories under your control
GNU Affero General Public License v3.0
569 stars 62 forks source link

RAW files (.CR2) not shown in Photos app but are shown in Files app. #530

Open Skeebopstop opened 3 years ago

Skeebopstop commented 3 years ago

Photos does not show previews of mimetypes from Camera RAW previews. The 'Files' app shows the previews properly (NOTE: I generated them using preview-generator), when I click on .CR2 etc.. from the 'Files' app it opens them in the preview viewer. When I switch to 'Photos' app, none of them show up (and folders which have purely CR2 are not shown at all).

Desktop (please complete the following information):

skjnldsv commented 3 years ago

Hi, Photos only supports jpeg and png for now.

@jancborchardt any insights? Would it make sense to add cr2? Do people really use raw that much? I guess we don't really lose anything to add them :thinking:

Skeebopstop commented 3 years ago

I'm quite certain Camera RAW previews app is a very popular one, I use it in conjuction with preview-generator. I guess my main confusion is, why wouldn't the Photos app be using the image mimetype to determine if it should display a preview or not, rather than looking at file name extension? After all, an image is an image which is a photo :)

skjnldsv commented 3 years ago

That's huge debate :) But mimetypes are linked to files extension, that doesn't change a lot. Nonetheless if we show all files with a preview that is not a photo app (pdf, text, anything that have a preview provider)

So we have to draw a line somewhere :shrug:

Skeebopstop commented 3 years ago

I didn't think .txt and .pdf etc.. would be registered as an 'image' mimetype and rather text/pdf or text? I just thought they'd have registered with a preview provider? Isn't there a difference?

skjnldsv commented 3 years ago

Yes, they will be seen as their associated mimetype: application/pdf Sorry, I might have misunderstood you? You said:

why wouldn't the Photos app be using the image mimetype to determine if it should display a preview or not, rather than looking at file name extension

I answered that we need to filter the mimetype before even having to check if a preview exists before. Using extensions or mimetypes to filter are pretty much the same :)

Skeebopstop commented 3 years ago

ok, I'm not sure what is best, it just seems to me that if something has a mimetype of 'image' (whether pdf or not) and has a preview provider registered, it should have all the appropriate sized preview jpegs generated for it and thus why not display it? It's just the presentation in the photos app which I really like, it's nicer than files when navigating huge servers with lots of files and folders.

I'm ultimately just keen to see .PSD and .CR2 as for photographers it's quite important, however it seems harder to maintain it that way. Perhaps a setting that's off by default is perhaps better to enable Photos to display all mimetypes with preview providers registered.

skjnldsv commented 3 years ago

Perhaps a setting that's off by default is perhaps better to enable Photos to display all mimetypes with preview providers registered.

That would defeat the entire purpose of photos. This would just be a files replacement. :shrug: I can already tell you this will not happen. Nonetheless expanding the list of images for photos editors/photographers is a nice idea! :+1:

TurkeyMan commented 3 years ago

My entire photo library is raw images. Photos is practically useless to me unless it's possible for the Camera RAW plugin to be able to inject its supported formats to the whitelist somehow. I agree it should not be that any mimetype that can be previewed shows in photos; I don't want PDF's and junk in my albums, but every format supported by Camera RAW is guaranteed to be a 'photo' (because that's what digital cameras do!), and it needs to be possible for that plugin to extend the whitelist of formats to include the formats it handles.

ariselseng commented 3 years ago

What about whitelisting all mimes with prefix "image/" that has a preview?

boecko commented 3 years ago

Actually this is an one-liner PR. But IMHO the list of mimetypes for Photos should be configurable

Wivik commented 3 years ago

Actually this is an one-liner PR. But IMHO the list of mimetypes for Photos should be configurable

Hello,

I've tried your fix for Nikon NEF files, but nothing in Photos.

In apps/photos/lib/AppInfo/Application.php :

       public const IMAGE_MIMES = [
                'image/png',
                'image/jpeg',
                'image/heic',
                'image/x-nikon-nef', // added this
                'image/tiff', // and added that
                // 'image/gif',                 // too rarely used for photos
                // 'image/x-xbitmap',   // too rarely used for photos
                // 'image/bmp',                 // too rarely used for photos
                // 'image/svg+xml',             // too rarely used for photos
        ];

Did I missed something ? I'm not a dev, but if it could help to support these files.

skjnldsv commented 3 years ago

Aaaah, I was too fast. I forgot that those previews are actually provided by the ariselseng/camerarawpreviews app. Meaninng if it's not installed, the photos app will wtill display the CR2 files, so that's not good. What we need is nextcloud/server#22873

So we can get the list of mimes that nextcloud supports, instead of relying on this hardcoded list.

boecko commented 3 years ago

Or, you could just let the user decide, which mimetypes he wants to see, regardless wether the plugin is installed or not.

IMAGE_MIMES + config-value

When https://github.com/nextcloud/server/issues/22873 is implemented, you can change that.

adi2k5 commented 3 years ago

One thing to consider here is, what and how will be displayed when there will be both CR2 + JPG in the same folder. It would be nice to have only one of them being shown in the preview (probably jpg would be better pick in that case, as it's much smaller thank CR2 and thus full picture will load also much faster), unless there will be a way to configure that. Otherwise we'd get doubled previews of photos and much worse loading times every second file. If I recall properly, the same problem is present ie. in gwenview from KDE, but that one can be at least solved with running 'gwenview *.JPG", on nextcloud instance that would be much bigger problem.

boecko commented 2 years ago

Could you just please extend the f*cking IMAGE_MIMES list with image/x-dcraw** like I did in my patch.?

When you happen to not have the Camera RAW Previews-app installed, a message is displayed, that the image is not previewable. So what? People who make pictures in RAW, will figure out that they need to install the right App.

On the other hand. People who make RAW photos might not be devs and don't want to wait months before someone fixes core.

Most photographers don't care about RAW+JPG. We have cRAW now. My workflow with a Canon EOS R6. Fire up FTPs-Connection to proftpd .. exiftool figures out the Path -> eg 2022/01/14 -> visible in nextcloud ... if Photos has image/x-dcraw in IMAGE_MIMES

boecko commented 2 years ago

Aaaah, I was too fast. I forgot that those previews are actually provided by the ariselseng/camerarawpreviews app. Meaninng if it's not installed, the photos app will wtill display the CR2 files, so that's not good. What we need is nextcloud/server#22873

So we can get the list of mimes that nextcloud supports, instead of relying on this hardcoded list.

this will not happen in the near future ... Just add the line.

CR2,3-Users will care JPG-Users will not notice it.