Loomio
Sun 28 Dec 2014 3:57PM

High resolution / full sized images for lightbox

DU [deactivated account] Public Seen by 157

Hi @all,

Since my first day on Diaspora I have wondered why images displayed in the lightbox are so small. They do not differ much from the in-stream version and sometimes it's hard to see the tiny parts of a picture.

To get a full-sized version of the image there is a little trick: You take the image URL and remove the "scaled_full" in front of the image filename, paste it in your address bar again and you get the original image file.

This trick is not well-known and I guess some users have difficulties to enlarge pictures.

My idea is to show a full-sized version (original version) of the image in the lightbox instead of the smaller scaled_full version. There is more than enough space to give images the space they need. We will keep having the scaled_full version in the stream as small footprint preview, but if you open the lightbox on that picture you will get the full version on your screen.

To prevent parts of the image being cut off due to small screen size, the lightbox will resize the full version to a size which fits the screen in width. This will happen dynamically and CSS-based.

There's a short screencast on my server to show my finished work: https://cloud.trashserver.net/public.php?service=files&t=1229224ef4da202a4c58160200008e8a

In my current code there is only a small border around the image. You can easily increase the border width if you want, but that's more detailed stuff we can discuss about later.

My updated code for Diaspora is finished so far. You can see the changes here: https://github.com/ThomasLeister/diaspora/compare/bigpics?expand=1

Let me know if you like the changes. If you do, we can easily merge my code to the Diaspora dev branch and have full-sized images in the next Diaspora* release :)

Update: Pull request on GitHib: https://github.com/diaspora/diaspora/pull/5500

Update2: Video on YouTube: https://www.youtube.com/watch?v=YMsm9MVl1T0

DU

Poll Created Sun 28 Dec 2014 4:05PM

Should Diaspora* have a full-size image lightbox? Closed Wed 14 Jan 2015 10:04PM

Agree: I like that! Merge this feature into diaspora-develop

Disagree: I don't like your idea.

Results

Results Option % of points Voters
Agree 91.7% 33 M R R TS M KAK PS JS A C DU Q G A GK DL TR L JL Y LM A AF D H 0 FL N S C DU D MM
Abstain 2.8% 1 JR
Disagree 5.6% 2 JH MB
Block 0.0% 0  
Undecided 0% 250 BK ST FS MS TS AA S CB HF BO DM GC JH F RF M EG G AX PC PP BB LP T DY SH DU H M RF R DM P DS EP E S AS MK R JD PP F PA SK A G TT J NV N CB BC T RD O MS RS- TM IS D MZ TM MB PG IGM M EK JS AL MS OU KM DS W MS P S JL N AKS SJ RD A N V A B S JB DC S S V AA C S MP GL DU VM E EA P DO DN FO TB JB L EM MM LS MS MM HSB AMQ DU VK D AV FL Y JD A AT S AM MDB M FS MM RV HL DU DV E E TA T R L T SP RF CM DE D M DU MJS J JHI E ED CC G J DU MS F NR B JM DS SA MN SM CG A FF CK L A KS RD M ATA UV N EL AC K AM KM RM H C MF AI AG TRA CJC S DU SC TM FT M GS DV BS LR HS S MS DA CA AF AS A MN T AR S GZ BJ AP J C TW HC T MK MC T MS R F EAP JB JD VP FC TT SD SS HE JM NL AA ASM A TJ M GZ C S CK

36 of 286 people have voted (12%)

R

rhaglion
Agree
Sun 28 Dec 2014 4:20PM

Finally, it's here. I think @Thomas Leister already mentioned why this is would be a good improvement.

C

Camil
Agree
Sun 28 Dec 2014 4:46PM

Great job, many honest thanks for your work!

AF

Alexander Finkhäuser
Agree
Sun 28 Dec 2014 5:03PM

nice ;)

JH

Jonne Haß
Disagree
Sun 28 Dec 2014 5:10PM

I think this needs further discussion before going into the voting phase, see https://github.com/diaspora/diaspora/pull/5500#issuecomment-68212836

KAK

Karthikeyan A K
Agree
Sun 28 Dec 2014 5:23PM

Great!

R

rhaglion
Agree
Sun 28 Dec 2014 10:59PM

I think @Thomas Leister already mentioned why this would be a good improvement.

S

sassonie
Agree
Tue 30 Dec 2014 9:55PM

I'm a photography lover and I like to see pictures in a nice resolution. And the original sized picture is already uploaded so why not show it to us?

DL

Dani'el Levity
Agree
Tue 30 Dec 2014 11:49PM

Resizable images directly in the stream would be awesome, too.. i have a tendency to attempt this, constantly, being a reddit RES user which does this.

LM

Lucas Meijer
Agree
Fri 2 Jan 2015 6:48PM

This is an excellent proposition which adds a lot of polish to the site!

MB

Marcelo Briones
Disagree
Sun 4 Jan 2015 9:09PM

Resources in pods are limited.

TR

trekkie@nomorestars.com
Agree
Tue 6 Jan 2015 4:39PM

I would prefer it to be an option to turn on/off in case you are running a limited resource pod.

JR

Jason Robinson
Abstain
Fri 9 Jan 2015 8:26PM

Kind of improvement, but as said by a few, the "real" fix would be to give podmins better configuration control regarding image uploads. As a temporary thing this does improve usability eg better image quality for viewing images at cost for podmin.

PS

Pavithran S
Agree
Wed 14 Jan 2015 8:00AM

Great , i would like full resolution , images are a very important form of communication for diaspora and there are lot of images which need zoom in.

S

shirish Sun 28 Dec 2014 4:14PM

I am not able to see or download the screencast. Can you upload the screencast somewhere else from where people could download it ?

GK

Georg Krause Sun 28 Dec 2014 4:17PM

I can see it @shirish
didn't checked the code but i agree to this change ;)

DU

[deactivated account] Sun 28 Dec 2014 4:20PM

DU

[deactivated account] Sun 28 Dec 2014 5:45PM

@jhass (https://github.com/diaspora/diaspora/pull/5500#issuecomment-68212836)

You are partly right with the bandwidth thing, but I am assuming that most people who see a picture in their stream won't load the full version. The traffic would just slightly increase by those users who load the full version of a picture they are interested in.

There are Upload limits on Diaspora anyway, so the impact on bandwidth won't be too huge I think.

Maybe it would be a useful archievement to introduce a caching engine, which caches frequently requested images on the user's pod itself. Traffic would be more decentralized then.

JH

Jonne Haß Sun 28 Dec 2014 6:31PM

Yet another consideration is that presenting only a version to the user that went through server side processing, might in some rare cases actually protect against uploading a malicious image that could exploit a flaw in a browser implementation. Though that's a not too likely scenario I guess.

FS

Florian Staudacher Sun 28 Dec 2014 9:12PM

I'm all for increasing the lightbox image size, but I have to agree with @jhass here. The implementation should be on the server-side and if we're already touching that part, we could make it configurable as well.

DU

[deactivated account] Mon 29 Dec 2014 9:37AM

Okay, another way to do it would be:

We introduce a new image version "scaled_lightbox" which is about 1500 px wide by default and make it configurable via the diaspora.yml. The admin is a server can then make his own decision about the size.

This scaled_lightbox version will be used in the lightbox. At the same time there will be a tiny link in the lightbox, which links to the original file. Users can then download the original file and be happy with it, because we are storing the original on the servers anyway.

The question is if it makes so much sense to differentiate between "scaled_lightbox" which has quite a big size... and the original file. If we have a look at the file sizes there probably won't be a big difference, because there are upload limits for images anyway. One version more just would need more disk space than if we only had thumb, thumb, scaled-full and original.

Let me remember: The original file can's be too big anyway because of the upload limit.

So my new suggestion is: Let's not introduce one more image version, but keep / correct the sizes of the current ones. In my opinion the original file should be shown in the lightbox, because it's size is limited by the upload limit anyway. To limit outgoing traffic for podmins, there should be a configurable upload limit for pictures in diaspora.yml. (See https://github.com/diaspora/diaspora/issues/3155)

This would help us save disk space and not to store hundreds of image versions on the servers ;) At the same time it's easy for users to get the original file by just opening the lightbox, doing a right click and save the image. Users with high DPI displays will be happy too, because they always get the most brilliant version of a picture in their lightbox instead of a shrinked or compressed version. Lightboxes are here to offer pictures in their whole beauty.

Let's try it like that and then see, how it influences the traffic on the servers. If traffic is too high, we should make a simple caching engine which caches frequently requested images. Server-2-Server traffic would be lower then.

@florianstaudacher what do you mean by implementing it server-side? You want to explicitly give the original file address to the imagebox instead of "guessing" it from the scaled_full address? But is that really necessary? Shouldn't the image store be consistent and always have a non-"scaled_full" version corresponding to a "scaled_full"-version? I think we can rely on that.

FS

Florian Staudacher Mon 29 Dec 2014 1:47PM

yeah, pretty much. we have the backend and frontend under control so no need to "guess" - just pass whatever we need to the JS. Any added complexity would have to be unit-tested and has a potential to contain errors.

JH

Jonne Haß Mon 29 Dec 2014 4:45PM

I really think we should just adjust scaled_full to our needs and not introduce yet another version, that's also easier when it comes to backwards compatibility. And I still think throwing the original away after processing might be a considerable option.

S

sassonie Wed 31 Dec 2014 2:23PM

We need to keep a balance between bandwidth consuming and 'cool features' (we need to attract new users). And of course safety should be top priority as Jonne Haß wrote.

Hmmm....maybe a limit on 1920x1080?

DU

[deactivated account] Thu 1 Jan 2015 7:54PM

The problem is that scaled_full is used in the stream and in the lightbox.

When we just increase scaled_full size, we will have big files being loaded when you scroll through the stream. => Bad for performance and bandwith.

When we leave scaled_full at the current size, the lightbox is quite useless.

We need different image sources for different use cases. If you have a look at the responses users want to have a lightbox with a big picture in it.

There are two ways to achieve that: Using the original file or introducing a new, bigger scaled version. As we have the original files on every server it would be an easy thing to just use these files ;) Would be great for backward compatibility, too.

MB

Marcelo Briones Sun 4 Jan 2015 9:08PM

I agree with Jonne Haß, we should just adjust scaled_full and throw the original away after processing.

Said that, I highly recommend to reconsider how we use d*, because from my point of view there are other softwares or servers to deal with images, example Gallery or flickr.

M

Maciek Łoziński Tue 6 Jan 2015 10:10AM

Some images after processing by diaspora scale-down algorithm have their colors changed, less contrast ( the only example I could find fast is unfortunately NSFW: https://despora.de/uploads/images/920301f9ee74745fb900.jpg vs https://despora.de/uploads/images/scaled_full_920301f9ee74745fb900.jpg ). There certainly should be an easy way of showing original image - either in lightbox or by showing an enlarge link.

DU

[deactivated account] Wed 14 Jan 2015 8:24AM

As I do not know how to implement the Ruby /backend stuff, I am not able to do any further improvement of the lightbox.

So it's simple like that: People obviously want this feature, so just take my code into the Diaspora Dev Branch or change it according to your imaginations ;) Maybe a config option to enable or disable full sized images in the lightbox. That would be the easiest solution.

But like I said: I dont's know anything about Ruby / Rails, so further development would have to be done by somebody else.