Photos: PNGs aren't recognized as photos

Created on 25 Feb 2020  Â·  24Comments  Â·  Source: nextcloud/photos

Steps to reproduce

Upload a photo that has the .png filename extension

Expected behaviour

The .png is recognized as a photo by the Photos app

Actual behaviour

The .png is not recognized as a photo by the Photos app, and therefore doesn't show up in Your photos, and it's parent folder isn't listed in Your albums.

Server configuration detail

Operating system: Linux 4.19.0-8-amd64 #1 SMP Debian 4.19.98-1 (2020-01-26) x86_64

Webserver: nginx/1.16.1 (fpm-fcgi)

Database: mysql 10.4.12

PHP version:

7.3.14
Modules loaded: Core, date, libxml, pcre, zlib, filter, hash, readline, Reflection, SPL, session, cgi-fcgi, bz2, ctype, curl, dom, fileinfo, ftp, gd, gmp, iconv, intl, json, ldap, mbstring, openssl, pcntl, PDO, pgsql, posix, standard, SimpleXML, smbclient, sodium, sqlite3, xml, xmlwriter, zip, exif, imap, mysqlnd, pdo_pgsql, pdo_sqlite, Phar, xmlreader, pdo_mysql, apcu, igbinary, redis, memcached, imagick, mcrypt, libsmbclient, Zend OPcache

Nextcloud version: 18.0.1 - 18.0.1.3

Updated from an older Nextcloud/ownCloud or fresh install: Older version of Nextcloud

Where did you install Nextcloud from: LinuxServer Docker image

List of activated apps

Enabled:
 - accessibility: 1.4.0
 - activity: 2.11.0
 - apporder: 0.9.0
 - calendar: 2.0.1
 - checksum: 0.4.4
 - cloud_federation_api: 1.1.0
 - comments: 1.8.0
 - contacts: 3.1.8
 - cookbook: 0.5.7
 - dav: 1.14.0
 - extract: 1.2.3
 - federatedfilesharing: 1.8.0
 - federation: 1.8.0
 - files: 1.13.1
 - files_downloadactivity: 1.7.0
 - files_pdfviewer: 1.7.0
 - files_rightclick: 0.15.2
 - files_sharing: 1.10.1
 - files_trashbin: 1.8.0
 - files_versions: 1.11.0
 - files_videoplayer: 1.7.0
 - firstrunwizard: 2.7.0
 - groupfolders: 6.0.1
 - issuetemplate: 0.6.0
 - logreader: 2.3.0
 - lookup_server_connector: 1.6.0
 - maps: 0.1.5
 - metadata: 0.11.1
 - news: 14.1.3
 - nextcloud_announcements: 1.7.0
 - notes: 3.1.5
 - notifications: 2.6.0
 - oauth2: 1.6.0
 - ocsms: 2.1.7
 - onlyoffice: 4.1.4
 - password_policy: 1.8.0
 - photos: 1.0.0
 - privacy: 1.2.0
 - provisioning_api: 1.8.0
 - ransomware_protection: 1.6.0
 - recommendations: 0.6.0
 - serverinfo: 1.8.0
 - settings: 1.0.0
 - sharebymail: 1.8.0
 - support: 1.1.0
 - survey_client: 1.6.0
 - suspicious_login: 3.1.0
 - systemtags: 1.8.0
 - tasks: 0.11.3
 - text: 2.0.0
 - theming: 1.9.0
 - twofactor_backupcodes: 1.7.0
 - twofactor_totp: 4.1.2
 - updatenotification: 1.8.0
 - video_converter: 0.1.3
 - viewer: 1.2.0
 - workflowengine: 2.0.0
Disabled:
 - admin_audit
 - encryption
 - files_antivirus
 - files_external
 - user_ldap

Configuration (config/config.php)

{
    "memcache.local": "\\OC\\Memcache\\APCu",
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
    "overwrite.cli.url": "https:\/\/cloud.haddock.cc\/",
    "overwritehost": "cloud.haddock.cc",
    "overwriteprotocol": "https",
    "trusted_domains": [
        "cloud.haddock.cc"
    ],
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "18.0.1.3",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "mysql.utf8mb4": true,
    "installed": true,
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_sendmailmode": "pipe",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "twofactor_enforced": "false",
    "twofactor_enforced_groups": [
        "admin"
    ],
    "twofactor_enforced_excluded_groups": [],
    "maintenance": false,
    "theme": "",
    "loglevel": 2,
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "1587"
}

Are you using external storage, if yes which one: Local

Are you using encryption: true

Are you using an external user-backend, if yes which one: No

Client configuration

Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0

Operating system: ArchLinux

2. developing enhancement

Most helpful comment

In principle, I have the same problem with png files, but I really admit that they can also be used as photos, and solve it with the .nomedia files, In 90% of cases it is more than enough.

Android Gallery uses that and it works well.. Maybe the improvement should be just make it easier

All 24 comments

Hey! :)

Can you give a little background on why do you have png photos?
I am not aware of any devices where you'll end up with png (yet, but I don't know every devices out there ;) )

Thanks for your report and your help! :rocket:

All of my PNGs are from screenshots on my phone and desktop.

Ah well. This app aimed to be photos oriented.
Let's ping @jancborchardt and hear from him :)

Well that's disappointing. So photos is not aimed at any artists or people who need high quality images?

This would also fall under scanned photographs from people who are backing up film negatives or backing up photos. Certainly don't want those saved in jpeg.

_Originally posted by @Dragon988 in https://github.com/nextcloud/photos/issues/223#issuecomment-594405123_


So I find this interesting, thanks everyone here for the help understanding your use of photos :)
So, my main concern is to not clutter the ui with unnecessary images.
Usually png are not photos, your use of it seems like a niche amongst usual users, right?
Or do you consider this as a real standard way?

For example, I have backups of websites hosted or stuff like that.
I don't want to suddenly see 2k sprites on photos, that would not make sense :)
Do you agree?

What solutions do you have in mind?

Usually png are not photos, your use of it seems like a niche amongst usual users, right?

Your use case is phone cameras which save as jpeg with raw images. But regular cameras shoot images in a variety of formats from raw to tiff and png/jpeg.

Most people who shell out the money for a dedicated camera will not use jpeg. Can't speak for everyone though.

Just my two cents! Have a good day.

Your use case is phone cameras which save as jpeg with raw images. But regular cameras shoot images in a variety of formats from raw to tiff and png/jpeg.

Exactly. We need to keep in mind nextcloud users are usually not professional photographer :)
That's why it's tricky to please everyone on those issues. You do agree that your use case is rather unusual, or do you think it's more common than we can think? :thinking:

You do agree that your use case is rather unusual, or do you think it's more common than we can think?

My particular use case is outside of the norm yes. Not even arguing that point :)

But going back to actual cameras. That's not a niche use case.. people do take pictures with regular cameras. It's not even a professional setting. Lots of people (myself included) use/have used dedicated cameras in the past.

Even if they opted to use jpeg from now on it doesn't change that their previous photographs are unviewable without converting them and causing quality loss.

Anyway, it's not crucial for this to be fixed on my end. I just wasn't sure if you were aware of the issue.

Even if they opted to use jpeg from now on it doesn't change that their previous photographs are unviewable without converting them and causing quality loss.

That is a valid point! Thanks :)

Anyway, it's not crucial for this to be fixed on my end. I just wasn't sure if you were aware of the issue.

Well, I think it is important to listen to different uses case ;)

Maybe support those files types with a minimum file size? That would exclude unwanted png/jpeg pretty fast ?

In principle, I have the same problem with png files, but I really admit that they can also be used as photos, and solve it with the .nomedia files, In 90% of cases it is more than enough.

Android Gallery uses that and it works well.. Maybe the improvement should be just make it easier

Yes, 141 is planned as well :)

Can the inclusion of specific file types in photos be optional?
In addition to PNGs not being included, HEICs are not shown in the app. This is perhaps another niche case but it is the default photo type for iOS devices with an A9 chip or above (iPhone 7 or later). This worked with the gallery app, provided the latest version of imagemagik was used.

@willyouvba this is pretty similar yes! :)
I guess it make sense for heic as well!

HEIC should for sure be supported, as they are a specifically "photo" file type. :)

PNGs still not sure … as @skjnldsv said this is a "Photos" app – for png graphic files there’s the Files grid view. We don’t want the view to be cluttered with irrelevant images and also not require people to use .nomedia (which most people do not know about). Are there any cameras which actually use png as photo file type?

iOS Photos for example offers to "Save Screenshot to Photos". A last resort for us could be a bottom left settings switch saying "Show non-photo image files", disabled by default. But it’s really not a priority for now.

To add my two cents to this:

I used to edit some of my photos with PS or GIMP and, mostly out of habit, I saved the result as PNG, so quite a lot of my photos are PNG. Out of the same habit I changed Open Camera on my Android, to save the images as PNG. So I _personally_ would prefer to be PNG a supported format.

As for the part of cluttering with irrelevant images and sprites: As soon as #141 is done this problem should "vanish in a puff of logic" [1].

Again, this is only a "nice-to-have" (maybe a "really-nice-to-have") but nothing that would break anything as the NC viewer still shows PNG without a problem.

Again, this is only a "nice-to-have" (maybe a "really-nice-to-have") but nothing that would break anything as the NC viewer still shows PNG without a problem.

This would work fine indeed, this is just a matter of default user experience :)
Thanks a lot for your feedback!

I'm scanning old photos rather to PNG than to JPEG so I got a bunch of pictures thar are png....

I understand that the photos app tries to be smart and use all photos in the whole cloud. Considering that as a preset, inclusion of other picture formats such as PNG might not be a good idea. However, at least in my cases (my company NC, my family NC, my club NCs) we have DEDICATED FOLDERS for pictures and in all cases, I want to see THEM only, and ALL types of images (including scans), this is PNG, TIF, BMP, etc.

Apart from that, if the Photos app would be here for pictures from digicams, then JPG is by far not the only image type to display, there would be different raw typs, HEIC, etc.

I discovered this topic almost randomly and I am flabbergasted.

I can assure you that many users has no clue such topic can even be discussed. People remotely interested in image manipulations -including photos- knows about PNG, especially since it is one of the most common, supported by all web browsers, format with lossless data compression.

So I cannot even understand that you wont consider not putting PNG in photos.

I already reverted to nextcloud 17 due to features regressions of Photo by comparison to Gallery. Dont tell me now I am expected to convert all my images to a destructive format to show them in Photos!

No seriously, PNG lack of support is not even an option.
I understand you might want to put a file filter option, why not. But miss PNG from the default set and I can name a bunch of people working in graphical design related industry that will check Photos for two seconds and then say "get me rid of this crap, if by default it does not handle some as basic, I do not even want to spend time to configure it".

It think the good starting point is to actually support what was in Gallery.
Thanks or your attention.

@yeupou care to share your use case for png instead of your unproductive frustration?
I don't see how your comment help anyone here nor give any sort of incentive to help you.

skjnldsv,

I think "supported by all web browsers" "lossless data compression" make a usecase by itself: anyone doing a photo blog, for instance, will be interested by this two points.
It's similar to the music player app: should it ignore FLAC because some software use FLAC for their event sounds?

Your first comment on this thread was "Can you give a little background on why do you have png photos?". I think it was quite necessary to voice the fact that PNG for photos is not some unheard of strange thing, many people use it (granted: people that tends to edit, modify, etc), some very often, and the lack of comments on this thread is probably not representative.

So the question is not whether there is incentive to "help" one individual posting here but whether a Photos app on something with such a general scope as nextcloud can actually arbitrarily ignore files based on their format.
The image-size based filter discussed on another thread makes much more sense.

Off topic
Moreover, the choice to switch from Gallery to Photos was already very questionable the way it appeared (no one seriously expect a switch from one stable version to another to get such feature regression). The fact that the name is now called "Photos" does not change the fact that some users were actually using galleries, which means images in general and not necessarily photos.

Update: ok forget it. I've just noticed you marked "off-topic" my comment to #320, because I felt it was related to this whole topic. Turns out #320 was exactly related to this topic.
Dont think about incentive to help me, think about helping yourself: your behavior does not advocate in favor of Nextcloud, especially when you do not even realize you might be dealing with people whose employers, not small accounts, are actually giving a try to Nextcloud these days.

Moreover, the choice to switch from Gallery to Photos was already very questionable the way it appeared (no one seriously expect a switch from one stable version to another to get such feature regression). The fact that the name is now called "Photos" does not change the fact that some users were actually using _galleries_, which means images in general and not necessarily photos.

Update: ok forget it. I've just noticed you marked "off-topic" my comment to #320, because I felt it was related to this whole topic. Turns out #320 was exactly related to this topic.
Dont think about incentive to help me, think about helping yourself: your behavior does not advocate in favor of Nextcloud, especially when you do not even realize you might be dealing with people whose employers, not small accounts, are actually giving a try to Nextcloud these days.

Please focus on the issue here which is all about png support or not.
Marking as off topic again. Head over to the existing forum threads if you want to understand the decisions for gallery.
Thanks & stay safe.

For the record, in Gallery (https://github.com/nextcloud/gallery), supporting more media types was a matter of having in config:

'enabledPreviewProviders' =>
array (
0 => 'OC\Preview\PNG',
1 => 'OC\Preview\JPEG',
2 => 'OC\Preview\GIF',
11 => 'OC\Preview\Illustrator',
12 => 'OC\Preview\Postscript',
13 => 'OC\Preview\Photoshop',
14 => 'OC\Preview\TIFF'
),

This discussion is unnecessary. There is a pull request to fix this at https://github.com/nextcloud/photos/pull/278
There’s even also one to add HEIC: https://github.com/nextcloud/photos/pull/318

If anyone wants to contribute, do it by testing and reviewing those pull requests. Locking the issue since it’s not productive anymore.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mikescops picture Mikescops  Â·  5Comments

JoshuaPettus picture JoshuaPettus  Â·  12Comments

tacruc picture tacruc  Â·  6Comments

szaimen picture szaimen  Â·  12Comments

GAS85 picture GAS85  Â·  11Comments