If a preview is created for an image, it should never be larger than the source image.
Some of the largest (pixel wise) generated preview images are larger (file-size wise) than the original image. I am no compression expert, but to me this does't seem right.
Disclaimer: I uploaded over 3000 heavily compressed JPGs (exported from LightRoom) and only a handful had previews larger than the original.
For example:
Original: 1.17MB | 2151x2323 | JPG
Preview: 1.48MB | 1896x2048 | PNG


Operating system: Linux cloud.mydomain.nl 4.4.0-78-generic #99-Ubuntu SMP Thu Apr 27 15:29:09 UTC 2017 x86_64
Web server: Apache/2.4.18 (Ubuntu) (apache2handler)
Database: mysql 5.7.18
PHP version: 7.0.18-0ubuntu0.16.04.1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, session, standard, apache2handler, redis, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, imap, intl, json, ldap, exif, mcrypt, mysqli, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, readline, shmop, SimpleXML, smbclient, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, libsmbclient, Zend OPcache
Nextcloud version: 12.0.0 - 12.0.0.29
Updated from an older Nextcloud/ownCloud or fresh install: fresh install
Where did you install Nextcloud from: used the Thech and Me VM
Signing status:
Signing status
[]
List of activated apps:
App list
Enabled:
- activity: 2.5.2
- calendar: 1.5.3
- comments: 1.2.0
- contacts: 1.5.3
- dav: 1.3.0
- federatedfilesharing: 1.2.0
- federation: 1.2.0
- files: 1.7.2
- files_pdfviewer: 1.1.1
- files_sharing: 1.4.0
- files_texteditor: 2.4.1
- files_trashbin: 1.2.0
- files_versions: 1.5.0
- files_videoplayer: 1.1.0
- firstrunwizard: 2.1
- gallery: 17.0.0
- issuetemplate: 0.2.1
- logreader: 2.0.0
- lookup_server_connector: 1.0.0
- nextcloud_announcements: 1.1
- notifications: 2.0.0
- oauth2: 1.0.5
- password_policy: 1.2.2
- previewgenerator: 1.0.6
- provisioning_api: 1.2.0
- serverinfo: 1.2.0
- sharebymail: 1.2.0
- systemtags: 1.2.0
- theming: 1.3.0
- twofactor_backupcodes: 1.1.1
- updatenotification: 1.2.0
- workflowengine: 1.2.0
Disabled:
- admin_audit
- encryption
- files_external
- survey_client
- user_external
- user_ldap
The content of config/config.php:
Config report
{
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"localhost",
"192.168.1.174",
"cloud.mydomain.nl",
"cloud.mydomain.nl"
],
"datadirectory": "\/var\/ncdata",
"overwrite.cli.url": "https:\/\/cloud.mydomain.nl\/",
"dbtype": "mysql",
"version": "12.0.0.29",
"dbname": "nextcloud_db",
"dbhost": "localhost",
"dbport": "",
"dbtableprefix": "oc_",
"mysql.utf8mb4": true,
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"instanceid": "ocab8j3aaavu",
"appstore.experimental.enabled": "true",
"mail_smtpmode": "smtp",
"mail_smtpauth": "1",
"mail_smtpport": "465",
"mail_smtphost": "smtp.gmail.com",
"mail_smtpauthtype": "LOGIN",
"mail_from_address": "www.techandme.se",
"mail_domain": "gmail.com",
"mail_smtpsecure": "ssl",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"preview_libreoffice_path": "\/usr\/bin\/libreoffice",
"memcache.local": "\\OC\\Memcache\\Redis",
"filelocking.enabled": true,
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "\/var\/run\/redis\/redis.sock",
"port": 0,
"timeout": 0,
"dbindex": 0,
"password": "***REMOVED SENSITIVE VALUE***"
},
"htaccess.RewriteBase": "\/",
"maintenance": false
}
Are you using external storage, if yes which one: files_external is disabled
Are you using encryption: no
Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...
Browser: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36
Operating system:
Web server error log
Insert your webserver log here
Nextcloud log
Insert your Nextcloud log here
Browser log
```
Insert your browser log here, this could for example include:
a) The javascript console log
b) The network log
c) ...
```
I was observing the same problem on my servers..
Since https://github.com/nextcloud/server/pull/10827
Save the HEIC previews as jpeg. Why are the jpg saved as PNG?
Maybe we should serve the original file if size is bigger? @rullzer @ChristophWurst @juliushaertl ?
Maybe @rullzer can tell if we could just switch to jpeg for previews or if PNG was chosen for a specific reason?
My guess is transparency :)
Ah yes 馃檲 good point
Well,
..a valid point for files that use transparencies (png, svg and gif's?).. :sweat_smile:
Can be make that all the thumbnails PNG for simplicity, which I understand was the original decision, whose only problem is the size (much larger in some cases) of the PNG thumbnails against the original JPEG files, or we differentiate how currently do with HEIC. :smile: :wink: :wink: :smiley:
This issue has been automatically marked as stale because it has not had recent activity and seems to be missing some essential information. It will be closed if no further activity occurs. Thank you for your contributions.
Friendly ping to do not stale it.. :wink:
Not sure if this will work in your case, I have limited the preview size to be much smaller, 1024 * 1024 due to this and a large amount of high quality images.
'preview_max_x' => '1024',
'preview_max_y' => '1024',
Highly compressed files take longer to generate, I think previews are made with GD which isnt as optimized as some other tools for small file sizes.
Reducing the size it can work with is a good step though, anything over 1024 in my use case the original image may as well be used.
Most helpful comment
Friendly ping to do not stale it.. :wink: