Show original image when clicking on it #518

Closed
opened 2026-02-19 23:10:17 -05:00 by deekerman · 30 comments
Owner

Originally created by @alexislefebvre on GitHub (Nov 20, 2020).

Originally assigned to: @lastzero on GitHub.

I use PhotoPrism with parameter PHOTOPRISM_THUMB_SIZE: 1024 to save disk space and when I open an image greater than 1024 px, I only see this thumbnail.

I would appreciate that PhotoPrism return the original image, it won't cost much resource for the server or the browser.

It could be added as an option to keep current behaviour.

It would also remove the need to have big thumbnails.

Originally created by @alexislefebvre on GitHub (Nov 20, 2020). Originally assigned to: @lastzero on GitHub. I use PhotoPrism with parameter `PHOTOPRISM_THUMB_SIZE: 1024` to save disk space and when I open an image greater than 1024 px, I only see this thumbnail. I would appreciate that PhotoPrism return the original image, it won't cost much resource for the server or the browser. It could be added as an option to keep current behaviour. It would also remove the need to have big thumbnails.
deekerman 2026-02-19 23:10:17 -05:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@alexislefebvre commented on GitHub (Nov 20, 2020):

Related to #247

@alexislefebvre commented on GitHub (Nov 20, 2020): Related to #247
Author
Owner

@lastzero commented on GitHub (Nov 22, 2020):

You should be able to do this by changing the config... note that browsers DON'T rotate JPEGs based on their metadata, so MANY pictures will have the wrong rotation, they will look blurry due to extremely basic resampling, and traffic will go way up when used remotely e.g. on a mobile phone.

@lastzero commented on GitHub (Nov 22, 2020): You should be able to do this by changing the config... note that browsers DON'T rotate JPEGs based on their metadata, so MANY pictures will have the wrong rotation, they will look blurry due to extremely basic resampling, and traffic will go way up when used remotely e.g. on a mobile phone.
Author
Owner
@lastzero commented on GitHub (Nov 22, 2020): See https://github.com/photoprism/photoprism/blob/develop/internal/api/thumbs.go#L134
Author
Owner

@lastzero commented on GitHub (Nov 22, 2020):

Also #157

@lastzero commented on GitHub (Nov 22, 2020): Also #157
Author
Owner

@lastzero commented on GitHub (Nov 22, 2020):

Docs: https://docs.photoprism.org/user-guide/settings/thumbnails/

@lastzero commented on GitHub (Nov 22, 2020): Docs: https://docs.photoprism.org/user-guide/settings/thumbnails/
Author
Owner

@alexislefebvre commented on GitHub (Nov 22, 2020):

See https://github.com/photoprism/photoprism/blob/develop/internal/api/thumbs.go#L134

Thanks for the answer.

Since the line contains c.Query("download") == "", I think it only works when downloading a photo.

@alexislefebvre commented on GitHub (Nov 22, 2020): > See https://github.com/photoprism/photoprism/blob/develop/internal/api/thumbs.go#L134 Thanks for the answer. Since the line contains `c.Query("download") == ""`, I think it only works when downloading a photo.
Author
Owner

@lastzero commented on GitHub (Nov 22, 2020):

Only works when not downloading.

@lastzero commented on GitHub (Nov 22, 2020): Only works when not downloading.
Author
Owner

@alexislefebvre commented on GitHub (Dec 6, 2020):

Does it mean that the idea is rejected and a PR to change this would be rejected?

@alexislefebvre commented on GitHub (Dec 6, 2020): Does it mean that the idea is rejected and a PR to change this would be rejected?
Author
Owner

@lastzero commented on GitHub (Dec 6, 2020):

I closed it because this seems already possible after we had this feature request before - did you test it?

See https://github.com/photoprism/photoprism/issues/157#issuecomment-573402110

@lastzero commented on GitHub (Dec 6, 2020): I closed it because this seems already possible after we had this feature request before - did you test it? See https://github.com/photoprism/photoprism/issues/157#issuecomment-573402110
Author
Owner

@alexislefebvre commented on GitHub (Dec 6, 2020):

You should be able to do this by changing the config... note that browsers DON'T rotate JPEGs based on their metadata, so MANY pictures will have the wrong rotation, they will look blurry due to extremely basic resampling, and traffic will go way up when used remotely e.g. on a mobile phone.

With a 1024x768 image, the endpoint /fit_2048 return a 720x480 image instead of the original image.

@alexislefebvre commented on GitHub (Dec 6, 2020): > You should be able to do this by changing the config... note that browsers DON'T rotate JPEGs based on their metadata, so MANY pictures will have the wrong rotation, they will look blurry due to extremely basic resampling, and traffic will go way up when used remotely e.g. on a mobile phone. With a 1024x768 image, the endpoint `/fit_2048` return a 720x480 image instead of the original image.
Author
Owner

@lastzero commented on GitHub (Dec 6, 2020):

Did you set PHOTOPRISM_THUMB_SIZE_UNCACHED & PHOTOPRISM_THUMB_SIZE to 720 in your config and restart before testing?

@lastzero commented on GitHub (Dec 6, 2020): Did you set `PHOTOPRISM_THUMB_SIZE_UNCACHED` & `PHOTOPRISM_THUMB_SIZE` to 720 in your config and restart before testing?
Author
Owner

@alexislefebvre commented on GitHub (Dec 6, 2020):

Thanks, it worked!

The doc says PHOTOPRISM_THUMB_UNCACHED will cause (high memory and cpu usage) , I thought it would use the CPU to generate all thumbnails and it would break everything, and it's not the case.

@alexislefebvre commented on GitHub (Dec 6, 2020): Thanks, it worked! The doc says `PHOTOPRISM_THUMB_UNCACHED` will cause _(high memory and cpu usage)_ , I thought it would use the CPU to generate all thumbnails and it would break everything, and it's not the case.
Author
Owner

@alexislefebvre commented on GitHub (Dec 6, 2020):

Here's a PR to explain it in the doc: https://github.com/photoprism/photoprism-docs/pull/34

@alexislefebvre commented on GitHub (Dec 6, 2020): Here's a PR to explain it in the doc: https://github.com/photoprism/photoprism-docs/pull/34
Author
Owner

@lastzero commented on GitHub (Dec 6, 2020):

The doc says PHOTOPRISM_THUMB_UNCACHED will cause (high memory and cpu usage) , I thought it would use the CPU to generate all thumbnails and it would break everything, and it's not the case.

Only when it is higher than PHOTOPRISM_THUMB_SIZE. If it is less or the same, there is no way to generate a thumb. Thus, the original is returned.

@lastzero commented on GitHub (Dec 6, 2020): > The doc says `PHOTOPRISM_THUMB_UNCACHED` will cause _(high memory and cpu usage)_ , I thought it would use the CPU to generate all thumbnails and it would break everything, and it's not the case. Only when it is higher than `PHOTOPRISM_THUMB_SIZE`. If it is less or the same, there is no way to generate a thumb. Thus, the original is returned.
Author
Owner

@intdel commented on GitHub (Jan 3, 2021):

It is still not very clear to me. If I set PHOTOPRISM_THUMB_SIZE_UNCACHED & PHOTOPRISM_THUMB_SIZE to 720, does it not just mean that the generated thumbnail it saves is max 720 and that the generated dynamic render is max 720?

It is also not clear to me how this forces photoprism to render the picture in higher resolution when clicking on it.

@intdel commented on GitHub (Jan 3, 2021): It is still not very clear to me. If I set PHOTOPRISM_THUMB_SIZE_UNCACHED & PHOTOPRISM_THUMB_SIZE to 720, does it not just mean that the generated thumbnail it saves is max 720 and that the generated dynamic render is max 720? It is also not clear to me how this forces photoprism to render the picture in higher resolution when clicking on it.
Author
Owner

@intdel commented on GitHub (Jan 3, 2021):

Ok now it makes sense. It is not very clear from the settings page that a restart is necessary :)

@intdel commented on GitHub (Jan 3, 2021): Ok now it makes sense. It is not very clear from the settings page that a restart is necessary :)
Author
Owner

@vaskozl commented on GitHub (Jan 30, 2021):

So I have a 4k display, using the default PHOTOPRISM_THUMB_SIZE: 2048, I'm generating and storing thumbnails up to 2048.

Without PHOTOPRISM_THUMB_UNCACHED: true I see 2048px images which are lower quality than the orignal.

With it, I see 4096px images, but they are slow to render even off and SSD with an overclocked RPi. Why doesn't Photoprism just show the original image instead of trying to make a minor resize to fit_4096?

The images Iphone takes are 4032x3024, after the "thumbnailing" it's still 4032x3024, but have slightly different colours.

My girlfriends Oneplus 6 takes 4608 wide photos which get resized down to 4096 (takes forever uncached). I'm comparing the 4608 and 4096 wide images on my 4k display in chromium and they look exactly the same when opened up at full size.

At the end of the day I either have to enable pre-generation up to 4096 photos and take up stupid amounts of space or otherwise wait an unacceptable amount of time performing resizing for no reason.

Even after photoprism resize to 4096 the photos still get resized down by chrome to so they can be displayed at the correct height/width in the browser window an end up being more like 3000px wide (haven't meassured exactly how much), so arguably the carefly done conversion by photoprism is utterly wasted.

I really love how quick normal thumbnails load and think that's awesome, but for full size images can we just drop the thumbnails and show the original image? It makes no sense to do anything else in terms of space and slowness and doesn't actually work as browsers end up resizing the image anyway.

@vaskozl commented on GitHub (Jan 30, 2021): So I have a 4k display, using the default `PHOTOPRISM_THUMB_SIZE: 2048`, I'm generating and storing thumbnails up to 2048. Without `PHOTOPRISM_THUMB_UNCACHED: true` I see 2048px images which are lower quality than the orignal. With it, I see 4096px images, but they are slow to render even off and SSD with an overclocked RPi. Why doesn't Photoprism just show the original image instead of trying to make a minor resize to `fit_4096`? The images Iphone takes are 4032x3024, after the "thumbnailing" it's still 4032x3024, but have slightly different colours. My girlfriends Oneplus 6 takes 4608 wide photos which get resized down to 4096 (takes forever uncached). I'm comparing the 4608 and 4096 wide images on my 4k display in chromium and they look exactly the same when opened up at full size. At the end of the day I either have to enable pre-generation up to 4096 photos and take up stupid amounts of space or otherwise wait an unacceptable amount of time performing resizing for no reason. Even after photoprism resize to 4096 the photos still get resized down by chrome to so they can be displayed at the correct height/width in the browser window an end up being more like 3000px wide (haven't meassured exactly how much), so arguably the carefly done conversion by photoprism is utterly wasted. I really love how quick normal thumbnails load and think that's awesome, but for full size images can we just drop the thumbnails and show the original image? It makes no sense to do anything else in terms of space and slowness and doesn't actually work as browsers end up resizing the image anyway.
Author
Owner

@lastzero commented on GitHub (Jan 30, 2021):

As explained in the docs, you may configure photoprism to return originals. Note that, as also explained in the docs, browsers may ignore their rotation and display them upside down. Get a faster server for a better user experience. Google also doesn't run Photos on a Pi.

@lastzero commented on GitHub (Jan 30, 2021): As explained in the docs, you may configure photoprism to return originals. Note that, as also explained in the docs, browsers may ignore their rotation and display them upside down. Get a faster server for a better user experience. Google also doesn't run Photos on a Pi.
Author
Owner

@vaskozl commented on GitHub (Jan 30, 2021):

I've read https://docs.photoprism.org/getting-started/config-options/ and I don't see an option to disable it?

Google doesn't use 4 cores of 2GHz to show you photos and neither does chrome when i go to view the photo directly.

My point is that resizing 4608 -> 4096, which the browser then resizes down again is pointless and wasteful. The storage of the 4096px image is also wasteful.

@vaskozl commented on GitHub (Jan 30, 2021): I've read https://docs.photoprism.org/getting-started/config-options/ and I don't see an option to disable it? Google doesn't use 4 cores of 2GHz to show you photos and neither does chrome when i go to view the photo directly. My point is that resizing 4608 -> 4096, which the browser then resizes down again is pointless and wasteful. The storage of the 4096px image is also wasteful.
Author
Owner

@lastzero commented on GitHub (Jan 30, 2021):

All commercial cloud hosting services use thumbs and pre render them. If you have other insights, please share them. Description should be in User Guide > Settings > Advanced.

@lastzero commented on GitHub (Jan 30, 2021): All commercial cloud hosting services use thumbs and pre render them. If you have other insights, please share them. Description should be in User Guide > Settings > Advanced.
Author
Owner

@lastzero commented on GitHub (Jan 30, 2021):

Screenshot_20210131_010436

@lastzero commented on GitHub (Jan 30, 2021): ![Screenshot_20210131_010436](https://user-images.githubusercontent.com/301686/106371050-5b050d00-6360-11eb-915c-825a22017895.jpg)
Author
Owner

@vaskozl commented on GitHub (Jan 30, 2021):

Thank you, but somehow I still can't get it work with full quality images:

With

      PHOTOPRISM_THUMB_SIZE: 2048    
      PHOTOPRISM_THUMB_UNCACHED: false

The fit_4096 returns a 2048 large image. It doesn't return the original size.

With:

      PHOTOPRISM_THUMB_SIZE: 2048    
      PHOTOPRISM_THUMB_UNCACHED: true

It returns a 4096 image after performing the (in my opionion unneeded) resize.

I tried both of these settings before my first comment. I do love photoprism, it's just my one grip that I can't view full quality photos properly.

@vaskozl commented on GitHub (Jan 30, 2021): Thank you, but somehow I still can't get it work with full quality images: With ``` PHOTOPRISM_THUMB_SIZE: 2048 PHOTOPRISM_THUMB_UNCACHED: false ``` The `fit_4096` returns a 2048 large image. It *doesn't* return the original size. With: ``` PHOTOPRISM_THUMB_SIZE: 2048 PHOTOPRISM_THUMB_UNCACHED: true ``` It returns a 4096 image after performing the (in my opionion unneeded) resize. I tried both of these settings before my first comment. I do love photoprism, it's just my one grip that I can't view full quality photos properly.
Author
Owner

@alexislefebvre commented on GitHub (Jan 30, 2021):

@Vaskozl I thought I had it working, as noted in my previous comments. But I had no image as big as yours nor 4K screen, so I added an image 7328 × 3424, 3.7 MB. And the URL fit_2048 returns an 2048 × 956 image (fit_4096 is not called because of my screen but calling it manually return a 4096 width image). And I don't understand why, I thought it returned the original images.

My settings:

  • Dynamic previews = True
  • Dynamic Size Limit: 7680px
  • JPEG Size Limit: 7680px

My screen has 2560 × 1440 resolution.

@alexislefebvre commented on GitHub (Jan 30, 2021): @Vaskozl I thought I had it working, as noted in my previous comments. But I had no image as big as yours nor 4K screen, so I added an image 7328 × 3424, 3.7 MB. And the URL `fit_2048` returns an 2048 × 956 image (`fit_4096` is not called because of my screen but calling it manually return a 4096 width image). And I don't understand why, I thought it returned the original images. My settings: - Dynamic previews = True - Dynamic Size Limit: 7680px - JPEG Size Limit: 7680px My screen has 2560 × 1440 resolution.
Author
Owner

@lastzero commented on GitHub (Jan 30, 2021):

You need to reduce the dynamic size limit if you want originals instead of resampled images.

@lastzero commented on GitHub (Jan 30, 2021): You need to reduce the dynamic size limit if you want originals instead of resampled images.
Author
Owner

@vaskozl commented on GitHub (Jan 30, 2021):

Is this the intended configuration:

# env | grep THUMB
PHOTOPRISM_THUMB_FILTER=lanczos
PHOTOPRISM_THUMB_UNCACHED=false
PHOTOPRISM_THUMB_SIZE=2048
PHOTOPRISM_THUMB_SIZE_UNCACHED=2048

When I right and open an image I can see it's loaded via the fit_4096 api call which still returns a 2048px photo :/
Using photoprism 20210128.

Edit, just trying the above settings now without UNCACHED: true

@vaskozl commented on GitHub (Jan 30, 2021): Is this the intended configuration: ``` # env | grep THUMB PHOTOPRISM_THUMB_FILTER=lanczos PHOTOPRISM_THUMB_UNCACHED=false PHOTOPRISM_THUMB_SIZE=2048 PHOTOPRISM_THUMB_SIZE_UNCACHED=2048 ``` When I right and open an image I can see it's loaded via the fit_4096 api call which still returns a 2048px photo :/ Using photoprism `20210128`. Edit, just trying the above settings now without `UNCACHED: true`
Author
Owner

@lastzero commented on GitHub (Jan 30, 2021):

See https://github.com/photoprism/photoprism/issues/157 for the original feature request and discussion. It's past 1am over here and weekend anyways, so I'm taking a break now.

@lastzero commented on GitHub (Jan 30, 2021): See https://github.com/photoprism/photoprism/issues/157 for the original feature request and discussion. It's past 1am over here and weekend anyways, so I'm taking a break now.
Author
Owner

@alexislefebvre commented on GitHub (Jan 30, 2021):

You need to reduce the dynamic size limit if you want originals instead of resampled images.

Right, I think I did it after your comment but I may have changed it after.

I just put "Dynamic Size Limit" to 720, flushed the browser cache, and fit_2048 never return the original image, it's never greater than 2048 width. And if I disable "Dynamic Previews", it returns a 720 width image.

@alexislefebvre commented on GitHub (Jan 30, 2021): > You need to reduce the dynamic size limit if you want originals instead of resampled images. Right, I think I did it after your [comment ](https://github.com/photoprism/photoprism/issues/627#issuecomment-739535164)but I may have changed it after. I just put "Dynamic Size Limit" to 720, flushed the browser cache, and `fit_2048` never return the original image, it's never greater than 2048 width. And if I disable "Dynamic Previews", it returns a 720 width image.
Author
Owner

@vaskozl commented on GitHub (Jan 30, 2021):

Got it to finally work with:

# env | grep THUMB
PHOTOPRISM_THUMB_UNCACHED=true
PHOTOPRISM_THUMB_SIZE=2048
PHOTOPRISM_THUMB_SIZE_UNCACHED=2048

So one has to set PHOTOPRISM_THUMB_UNCACHED=true and also reduce the PHOTOPRISM_THUMB_SIZE_UNCACHED=2048, wasn't obvious to me at all.

@lastzero Thank you and good night ;)

@vaskozl commented on GitHub (Jan 30, 2021): Got it to finally work with: ``` # env | grep THUMB PHOTOPRISM_THUMB_UNCACHED=true PHOTOPRISM_THUMB_SIZE=2048 PHOTOPRISM_THUMB_SIZE_UNCACHED=2048 ``` So one has to set `PHOTOPRISM_THUMB_UNCACHED=true` and also reduce the `PHOTOPRISM_THUMB_SIZE_UNCACHED=2048`, wasn't obvious to me at all. @lastzero Thank you and good night ;)
Author
Owner

@alexislefebvre commented on GitHub (Jan 30, 2021):

I had it working too. I had to change PHOTOPRISM_THUMB_SIZE_UNCACHED from 7680 to 720. It looks like doing it through the Settings page was ignored.

2 users and me were confused by this configuration, I'll try to improve the documentation.

@alexislefebvre commented on GitHub (Jan 30, 2021): I had it working too. I had to change `PHOTOPRISM_THUMB_SIZE_UNCACHED` from 7680 to 720. It looks like doing it through the Settings page was ignored. 2 users and me were confused by this configuration, I'll try to improve the documentation.
Author
Owner

@lastzero commented on GitHub (Jan 30, 2021):

Setting to 720 is not required and might result in other issues,. Use the same as static. If you then allow non pre rendered previews, the only option is to return the original. Maybe uncached might be confusing but changing the name will brake existing configs. A restart might be required when changing it in the Advanced Settings UI.

@lastzero commented on GitHub (Jan 30, 2021): Setting to 720 is not required and might result in other issues,. Use the same as static. If you then allow non pre rendered previews, the only option is to return the original. Maybe uncached might be confusing but changing the name will brake existing configs. A restart might be required when changing it in the Advanced Settings UI.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/photoprism#518
No description provided.