You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Thumbnail API, e.g. /index.php/apps/files/api/v1/thumbnail/253/253/Shared/temp.jpg should obey the file type and return the same filetype as thumbnail:
jpg -> jpg
png -> png
old version:
Hello,
I have developed the thumbnail generation on android app and we use the new route
/index.php/apps/files/api/v1/thumbnail/253/253/Shared/temp.jpg
Opening this url in the browser lets me download a png file.
If you have a small jpg file: 587x720 with 77,2 kb and get a thumbnail of it I get a png file with:
253x253 with 113,7kB.
So it is bigger than the original file.
I suggest to use jpg with compression to get a smaller file size:
Originial: 77,2kb
PNG: 113,7kb
jpg of png: 19,5kb
compressed at 80% jpg of png: 16,1kb.
For me there is no visible difference between them, but we would save a lot of traffic.
I'd personally prefer to stay with png as it's lossless. JPG is good for photographies but pretty bad for everything else. PNG can handle both fine, the only downside is that the files might be bigger.
@georgehrke As it is only for thumbnails and they are transferred over the internet I think it is more important to have a smaller file size.
I know that JPG is not so good for text images, but I guess the most images are photographies.
@georgehrke Another idea I had: Why not use the same filetype for thumbnails as the original file is? jpg would be jpg thumbnails and png -> png.
With this it would be up to the user what filetype they use.
@tobiasKaminsky With randomly I mean that the client which uses api would have to check the mime type (is it jpg or something else) and then expect different image types of the preview. It should always return the same format.
Is there an update?
As we are getting closer to OC8, and this is the first version that supports thumbnail download for android app, it would be great to have this included, as otherwise we are wasting a lot of bandwidth.
Unfortunately I cannot do this by myself :/
bump
I am currently developing a feature that loads reduced versions of images to a cache.
With this the bandwith is reduced dramatically on the android app.
But for this it is necessary to have a jpg reduced version of an original jpg file as otherwise the file size is too high and the benefit is far less or even not existent.
@oparoz Can you help me with this? Or can you give me a hint, where to adjust this myself?
As the related PR will be merged in nearer future we need this.
Fun fact, on 8.1+, you're already getting a JPG :D, it just has the wrong extension.
I don't think lowering the quality is a good idea.
4156x3118 JPG | 5.05MB
2048x1536 max preview | 753KB
Activity
LukasReschke commentedon Nov 6, 2014
@georgehrke Would it make sense to use JPG per default for our previews?
georgehrke commentedon Nov 6, 2014
I'd personally prefer to stay with png as it's lossless. JPG is good for photographies but pretty bad for everything else. PNG can handle both fine, the only downside is that the files might be bigger.
tobiasKaminsky commentedon Nov 6, 2014
@georgehrke As it is only for thumbnails and they are transferred over the internet I think it is more important to have a smaller file size.
I know that JPG is not so good for text images, but I guess the most images are photographies.
tobiasKaminsky commentedon Nov 7, 2014
@georgehrke Another idea I had: Why not use the same filetype for thumbnails as the original file is? jpg would be jpg thumbnails and png -> png.
With this it would be up to the user what filetype they use.
georgehrke commentedon Nov 8, 2014
@tobiasKaminsky The api should always return the same file format and not randomly change between png and jpg
tobiasKaminsky commentedon Nov 8, 2014
@georgehrke what do you mean with ranomly? Currently all thumbnails are png.
But, as I suggested before, I agree with your latest idea.
georgehrke commentedon Nov 8, 2014
@tobiasKaminsky With randomly I mean that the client which uses api would have to check the mime type (is it jpg or something else) and then expect different image types of the preview. It should always return the same format.
[-]Preview uses PNG[/-][+]Thumbnail API should keep file type[/+]tobiasKaminsky commentedon Nov 9, 2014
@georgehrke
Ok. I have changed the title and the description of this issue.
oparoz commentedon Nov 21, 2014
Maybe make it an option via the URL, so that apps can have a setting which trades bandwidth for quality?
tobiasKaminsky commentedon Jan 10, 2015
Is there an update?
As we are getting closer to OC8, and this is the first version that supports thumbnail download for android app, it would be great to have this included, as otherwise we are wasting a lot of bandwidth.
Unfortunately I cannot do this by myself :/
tobiasKaminsky commentedon Apr 16, 2015
bump
I am currently developing a feature that loads reduced versions of images to a cache.
With this the bandwith is reduced dramatically on the android app.
But for this it is necessary to have a jpg reduced version of an original jpg file as otherwise the file size is too high and the benefit is far less or even not existent.
oparoz commentedon Jun 6, 2015
I propose to do this:
It's not perfect, but would be an acceptable solution.
tobiasKaminsky commentedon Jun 8, 2015
I am fine with this. As long as the preview size is not bigger than the original file :)
tobiasKaminsky commentedon Sep 17, 2015
Any update on this?
It is not good to have the previews on our owncloud app with these large PNGs...
tobiasKaminsky commentedon Sep 30, 2015
@oparoz Can you help me with this? Or can you give me a hint, where to adjust this myself?
As the related PR will be merged in nearer future we need this.
Thank you!
oparoz commentedon Oct 1, 2015
Fun fact, on 8.1+, you're already getting a JPG :D, it just has the wrong extension.
I don't think lowering the quality is a good idea.
4156x3118 JPG | 5.05MB
2048x1536 max preview | 753KB
oparoz commentedon Nov 5, 2015
Since the file is of the correct type, should we close this or is the extension important?
tobiasKaminsky commentedon Nov 5, 2015
There are a few operation systems that rely on the correct extensions, so there should e the correct extension I guess.