Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview images larger than original ( 1.1MB original / 1.5MB preview ) #5316

Closed
FlyingNimbus opened this issue Jun 9, 2017 · 11 comments
Closed
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: previews and thumbnails needs info

Comments

@FlyingNimbus
Copy link

FlyingNimbus commented Jun 9, 2017

Steps to reproduce

  1. Upload compressed JPGs
  2. Create previews, I used the Previews Generator App
  3. Check preview sizes

Expected behaviour

If a preview is created for an image, it should never be larger than the source image.

Actual behaviour

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

untitled
all_files

Server configuration

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
</details>

**The content of config/config.php:**
<details>
	<summary>Config report</summary>

{
"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
}

</details>

**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/...

### Client configuration
**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:**

### Logs
#### Web server error log
<details>
	<summary>Web server error log</summary>
	```
	Insert your webserver log here
	```
</details>

#### Nextcloud log (data/nextcloud.log)
<details>
	<summary>Nextcloud log</summary>
	```
	Insert your Nextcloud log here
	```
</details>

#### Browser log
<details>
	<summary>Browser log</summary>
	```
	Insert your browser log here, this could for example include:

	a) The javascript console log
	b) The network log
	c) ...
	```
</details>
@FlyingNimbus FlyingNimbus changed the title Preview images larger than the original ( 1.1MB original / 1.5MB preview ) Preview images larger than original ( 1.1MB original / 1.5MB preview ) Jun 9, 2017
@nextcloud-bot nextcloud-bot added the stale Ticket or PR with no recent activity label Jun 20, 2018
@matiasdelellis
Copy link

I was observing the same problem on my servers..

@nextcloud-bot nextcloud-bot removed the stale Ticket or PR with no recent activity label Sep 1, 2018
@matiasdelellis
Copy link

Since #10827
Save the HEIC previews as jpeg. Why are the jpg saved as PNG?

@skjnldsv skjnldsv added the 0. Needs triage Pending check for reproducibility or if it fits our roadmap label Jun 12, 2019
@skjnldsv
Copy link
Member

Maybe we should serve the original file if size is bigger? @rullzer @ChristophWurst @juliushaertl ?

@juliushaertl
Copy link
Member

Maybe @rullzer can tell if we could just switch to jpeg for previews or if PNG was chosen for a specific reason?

@skjnldsv
Copy link
Member

My guess is transparency :)

@juliushaertl
Copy link
Member

Ah yes 🙈 good point

@matiasdelellis
Copy link

Well,
..a valid point for files that use transparencies (png, svg and gif's?).. 😅

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. 😄 😉 😉 😃

@ghost

This comment has been minimized.

@ghost ghost added the stale Ticket or PR with no recent activity label Jul 12, 2019
@matiasdelellis
Copy link

Friendly ping to do not stale it.. 😉

@kesselb kesselb removed needs info stale Ticket or PR with no recent activity labels Jul 12, 2019
@skjnldsv skjnldsv added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Jul 12, 2019
@exussum12
Copy link
Contributor

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.

@szaimen
Copy link
Contributor

szaimen commented Nov 26, 2022

Hi, please update to at least 23.0.12 and report back if it fixes the issue. Thank you!

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 1. to develop Accepted and waiting to be taken care of labels Nov 26, 2022
@szaimen szaimen closed this as completed Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: previews and thumbnails needs info
Projects
None yet
Development

No branches or pull requests

9 participants