Hacker News new | past | comments | ask | show | jobs | submit login
Viewer.js – JavaScript image viewer (github.com/fengyuanchen)
142 points by chenfengyuan on Jan 27, 2016 | hide | past | favorite | 106 comments



There are usages for this kind of image viewer but frankly I find them very annoying most of the time. A good example to follow is the Boston Globe's Big Picture (click in any image at https://www.bostonglobe.com/news/bigpicture to see a gallery). Just having all images in a good resolution, vertically stacked in a page has an awesome user experience. I can just scroll which fells very natural, and images will just load in background. If you want to go fancy you can have some JS to control in which order the images should load, and limit the bandwidth.


I also dislike "gallery" type of presentations. I also prefer an example similar to the "bostonglobe.com", perhaps with some blazy effects http://dinbror.dk/blazy/.


I prefer this too.

But I guess that people who know stuff about photography will say the photos won't get the needed exposure...


We have our saas startup and one of the main point was loading images order, it changes the user perception a lot especially since our users insist in having hundred megabytes worth of photo (but I'm working at automatically optimizing them)


My screen is a bit too small and I can't see the complete picture. Makes me have to scroll back and forth to read the text and look at the image. For my screen I would have preferred gallery in this case.


Try resizing the window.


At a certain point, scrolling past 20 images is annoying.


Here's my lightbox implementation:

    <a href="photo.jpg" target="_blank"><img src="photo_thumb.jpg"/></a>
Works in all browsers, native, lightweight, public domain.


=)

I prefer it without the target attribute, generally because I prefer navigating back than closing a window. This is especially true on phones. Power users on desktop computers usually know how to open in a tab using the third mouse button or Ctrl-clicking.


If a link opens in a new tab on Android, the back button closes the tab.


I didn't know that. Neat. Then maybe iOS will get this one day.

I would like some kind of reverse Ctrl-click, that would force links to open in the same window as the one I'm currently in. I just don't know how this should work, if I click a link while I'm filling in a form. :-/


Might be cool, but I closed my tab immediately. I work on an open team with quite a few women and other folks who would immediately react negatively to the sexy Emma Watson example photos. Bring on the downvotes, but even if this is an irrational negative reaction, it's a real one. If you want this to be a useful and universal library consider your example images. If you want it to be used only by people who aren't bothered by this, then plow straight ahead.

It's 2016, let's not propagate the mess that was Lenna: https://en.wikipedia.org/wiki/Lenna


Why?

Its just an example gallery that happens to be of a photo shoot of Emma Watson. The photo's aren't even remotely suggestive... Are your female co-workers that sensitive and/or unable to rationalize? Would you have kept looking at the demo if it was filled with similar pictures of Brat Pitt?

Not trying to be mean or anything I genuinely don't understand and would like to know.

EDIT:

I do see and agree that a more varied subject matter would probably do better to showcase the usage of the plugin but I still think that your reaction is slightly extreme as it seems like you look down on your female co-workers by removing their agency in the matter :S (although that might be taking it to the extreme from my side...)


Besides, Emma Watson (of all possible examples) is an outspoken advocate of women's rights (https://en.wikipedia.org/wiki/Emma_Watson#Women.27s_rights_w...). I feel reasonably confident that she would have no problem with this application (IP issues aside).

EDIT: I'm not making any point about the appropriateness of this for your workplace. That depends entirely on your workplace.


Yes, I for one would have kept looking at the demo if it was Brad Pitt.

But that's not the point. Sexism, in reality, favours men and hurts women. That's why an image of Brad Pitt is okay, whereas an image of Emma Watson is not okay! (and by the way, they are suggestive)

Any argument that goes "But if we switched genders, then it would be fine!" is completely missing the point that we are still living in a de-facto patriarchy, where objectification of men is not even an issue.

In any case, I found the choice of images immature and closed the website right away.


>"But that's not the point. Sexism, in reality, favours men and hurts women. That's why an image of Brad Pitt is okay, whereas"

If seeing attractive women "hurts women", then by that you have to concede that the same happens to men when it comes to attractive men. Not only that, but "sexism" against men occurs on multiple levels in our society, so much so that we are actively blind to it, see your comment as well as below.

>"Any argument that goes "But if we switched genders, then it would be fine!" is completely missing the point that we are still living in a de-facto patriarchy, where objectification of men is not even an issue."

It's odd how you claim "defacto" patriarchy, then concede that this patriarchy allows the objectification of men to occur as a non "issue". The fact that it's okay in this society to objectify men but not women is not proof of patriarchy, if anything it's proof of "matriarchy" (if we borrow feminist-naming conventions).

We are still far from true equality, and it is something we should strive for as an enlightened society. But to blatantly have double-standards while claiming systemic inequality is quite disingenuous.


I don't "claim" patriarchy, it's the reality.


It's not my reality. But it is your reality. Where does that leave us?



Yep, I'm not ignorant of those kinds of stats, I just dispute the interpretation. Patriarchy is ideology not fact, and a divisive one at that. Its a narrow combative view of gender interaction that does more harm than good.


Since everyone is getting into the concept of the patriarchy here and how it is the damnation of Western civilization... I'd like to point that the to my knowledge these developers are from China.

They're not even a part of the same cultural gestalt.

Isn't it possible this is just an example of mistaken manners when dealing with a foreign culture?


> But that's not the point. Sexism, in reality, favours men and hurts women. That's why an image of Brad Pitt is okay, whereas an image of Emma Watson is not okay! (and by the way, they are suggestive)

> Any argument that goes "But if we switched genders, then it would be fine!" is completely missing the point that we are still living in a de-facto patriarchy, where objectification of men is not even an issue.

I'm talking about his co-workers reactions to said images (whether Brad Pitt or Emma Watson) not about sexism. As a matter of fact I don't see how the two are related at all, what in this scenario is sexist? But since you brought it up; I do not agree with you at all because I think sexism (or the "patriarchy" whatever you want to call it) hurts men AND women. Even if it might not be the same type of hurt or even have the same effects. I think the biggest problem for us as people (humanity) is when we start quantifying and differentiating between different types of "hurt".

> In any case, I found the choice of images immature and closed the website right away.

Pictures of an adult woman's face are immature? You say it is suggestive but I don't find them suggestive at all, does that mean I'm immature or not?

Like I mentioned in my original post I don't understand the standpoint of OP and neither do I understand yours. What makes these images immature and what validates the OP's reaction that he wanted to protect his female co-workers from this imagery. Or did he try to protect himself from the reactions of his female co-workers to this imagery?

Again none of this is meant to be taken as an insult or attack I would genuinely like to understand why you feel this way.


It's the fact that whenever there are sexy people as placeholders, it is always women and never men. That's sexism right there. We just got used to it.


At work, our main product is an image manipulation and display software so as you might expect we use a lot of placeholder images when designing the UI/UX flows.

If you peek over our leads shoulder, you'd see she nearly universally uses close up facials of 'sexy' men or whoever happens to be the latest group of fashion models on ANTM.

People use images that appeal to them. They're not going for broad universal appeal.

----

Also I find it highly ironic that people in this thread are suggesting we replace fully clothed images of a woman who became famous for doing a children's TV series, with images of Lena Söderberg 1972 playboy centerfold because it is 'traditional'.

If people will take offense to Emma being 'sexy', I'm not sure what they're going to do if you use the full spread of images that the famous "Lena" shot was cut from. After all the point of this image viewer is to show different images, is it not?


More women need to create items that require placeholder images, some of which will choose to use pictures of sexy men.

In that regard, it's uneven representation moreso than sexism.


> It's the fact that whenever there are sexy people as placeholders, it is always women and never men. That's sexism right there. We just got used to it

Always and never are strong terms that I'm not sure of in this context but I understand and agree (to an extend), thank you for explaining :)

As far as whether OP's reaction was justified I guess we'll have to agree to disagree or something...

EDIT: Although I'm not sure that your "solution" to the problem (looking at picture galleries of hot males) is one that works...

(just kidding)


Well, I tried to remember if I ever saw a sexy male in a tech presentation or demo, and I couldn't... but of course, it's not actually "never" and "always".


There are more people of middle and upper class economic status posting on HN, we just got used to it, etc. etc.

The majority of fashion is targeted at women, therefore there are more female models, therefore there are more quality pictures of women out there than men, therefore it makes sense to use it as a test image gallery.

Also, if the code is being used to display test images, this is probably closer to the normal subject matter it'll be used for.


> The majority of fashion is targeted at women

I actually complained once to my favourite label about their very limited choice of fashion for men. They replied that it's because men don't buy very much, which is funny since men don't even have the choice to begin with.

> therefore there are more quality pictures of women out there than men, therefore...

It's a bad reason to use the status quo to justify itself.


> Any argument that goes "But if we switched genders, then it would be fine!" is completely missing the point that we are still living in a de-facto patriarchy, where objectification of men is not even an issue.

Is not an issue to who? Just because women face it more, does not mean that men do not face it. Winner does not take all, everyone just loses.


In an Ivory tower, sure. This is the argument used to support the status quo - because any change is not 'perfect' why bother?


> Yes, I for one would have kept looking at the demo if it was Brad Pitt.

That makes you the sexist in this instance.


Because I try to be sensitive to sexism and react accordingly, that makes me sexist?


No, because you're treating each sex differently based on their sex.


You should have read the rest of the post before commenting.


I did.


> where objectification of men is not even an issue

What about the objectification of men that calls them "warriors" and sends them off to serve their country as tools of the state? To get killed doing that? That sort of objectification isn't an issue? Or we only worry about the case where women have the freedom to pose in front of a camera and get paid for it if they want to?


I guess you could say that you can opt out of warrior identification fairly easily---just grow old.

No one can really opt out of identification in terms of their beauty. Both men and women face the reality of being judged by their looks, but women bear the brunt of it due to cultural considerations.

In some cultures, as women age they no longer have to deal with being judged as harshly on looks but in the West beauty is a point of interest deeply into a woman's middle-aged life at the least, and even people who are technically the age of grandparents like Hillary Clinton are judged on their looks.


Conscription was a reality for men about half a century ago, and could be again during a war. The laws are ready for that. Forced national service is a reality in many countries.


It's not so much the content of the images but more the lack of variety. So rather than looking like the placeholder images you often find in empty photo frames, it starts to look more like an Emma Watson fan page. Which might make some people feel unfortable if their workplace has stricter guidelines about internet usage.


Not sure why this is getting downvotes. The simple fact of the matter is that a lot of men and women wouldn't be comfortable clicking around a gallery of <cute-girl-photoshoot> in front of their peers for fear of becoming "that weirdo who spent 6 minutes zooming in on Emma Watson's elbow". This may not apply in small workspaces where everyone is chummy and socially comfortable, but not everyone has this luxury.

Whether or not this is sexism is one thing, but it's still a very real concern.


> "that weirdo who spent 6 minutes zooming in on Emma Watson's elbow"

Hahaha I can see how that'd be a problem but OP specifically mentioned the gender of his co-workers which struck me as weird.


Thanks! That makes a lot of sense...

Although I do question whether OP meant the same thing as he specifically mentioned the gender of his co-workers which in such a scenario would be rather irrelevant.

Since I'm in the comfort of my own home I totally overlooked this option :S


i think it boils down to this: if you work in an office where browsing photo galleries of women is not frowned upon, then ok; but that is generally considered unprofessional (and immature) behavior in most workplace cultures -- that is, behavior you'd want to avoid exhibiting at work.


Yeah. "Looking at pictures of hot chicks" is total bro culture, and unprofessional.


If I need placeholders, I use pictures of classical art because there's no copyright encumberment, you get examples of human beings, and its aesthetically pleasing.

As a side-benefit, even if the portraits are laviscious since its 'classical art', many people don't care.


This is not remotely suggestive? ....Okay.

https://fengyuanchen.github.io/viewerjs/img/emma-watson-4.jp...


I'm in my 40s and I also have the same reaction. The LAST thing I want anyone to think of me as a dirty old guy. So if this was on my computer that would be my fear.


It has nothing to do with being sensitive. It is extremely suspect. They're not exactly a family photoshoot.


If nothing else, it's almost certainly copyright infringement.


I definitely agree that that is a problem and a creative commons image library would have been better but for the discussion at hand (the reaction of the female co-workers of OP) I think that is an irrelevant point.


The world where these particular sample images require a NSFW warning is FAKE. It's 100% manufactured 'drama'. The natural human reaction, from both sexes, to these photos (which can even be seen in other comments here) is "those are nice pictures" or "she's pretty" and NOT "OMG, I shouldn't be displaying these, I might offend someone." Excuse the language, but this is a quintessential example of 'PC bullshit'. Grow a goddamn spine, people. Come on, there are much, much more important, relevant, and pressing things to worry about than whether or not your co-workers might disapprove of some random images of a FULLY CLOTHED female human being on a website.

How sad.


I had the same reaction as the OP. I wasn't worried about offending people, I was embarrassed that co-workers might think I was looking at sexy pictures at work.


What's wrong about looking at some pictures that are by no standards NSFW? And again, at work you're supposed to be working, not checking out the latest js libraries and commenting on HN, so the fact that the pictures are those of Emma Watson or those of Peter Pan is irrelevant.


I'm in a similar situation to the original OP.

I do web dev work in an open office area where I'm surrounded by people who don't really understand what I get paid to do.

My boss is aware however, and I'm very confident that me investigating new js image viewer libs, browsing and posting on HN falls with in my job description.

I instantly closed the demo gallery because as much as it annoys me the perception of those around me matters.

I'm completely on board with your thoughts that these images are SFW and it shouldn't be an issue. I'm confident that I would be able to rationally explain why I happen to have a page full of Emma Watson pictures open. However, I wouldn't get the chance to explain. If someone around me noticed they'd immediately think that I was slacking off and looking at pictures of cute women on the internet.

If the demo images were of basically any other SFW subject matter it wouldn't be an issue.

I totally agree that the whole situation that this is even a concern is annoying as all hell. That doesn't stop it from being a thing.

:(


At this point I'm not sure if it's even the perception of those around you and not what those around you think the perceptions of those around them might be.


You act like warnings are a form of censorship. The point is to help the person clicking the link, not the people around them who may accidentally see. I want my computer screen to appear professional which means no Facebook, albums of pretty men/women, and no Disney characters.


Thinking this stuff is unreasonable will not save you from a "hostile environment" lawsuit over it. Wise employers won't take an existential risk by allowing thoughtcrime in the office.


I use my spine to stand up to this regressive and harmful attitude.


It may very well be 'regressive' -- in the sense that it regresses back to before some of the public went essentially limp, to before political correctness comes before natural human rationale in people's pattern of thinking, it regresses back to relative normalcy instead of ridiculousness.


Please sit down.


I use mine to stand up for free speech. Who does this harm exactly? Who is the victim, specifically?


What does this have to do with free speech? You're allowed to say what you want, and I'm allowed to close the tab and not read it.


Of course you can close the tab, but I find attempts at censorship like this regressive and harmful.


This is hyperbole. There is no attempt at censorship here. No one has disallowed anyone to view anything.

If you think a critical comment qualifies as an attempt at censorship, then by the same logic, your own comments are an attempt to censor the OP.


In fairness, the images were tasteful. However I do agree with you that it would have been better to use a mixture of different content (landscapes, architectures, people) as well as subjects (male, female). Having only portraits of one individual can end up looking a little pervy.

They probably should also use creative commons images - if they're not already.


I disagree.

It would be weird if it was a collection of various images from different times of the same person, or a collection of female celebrities.

But it's a series of images from the same photoshoot. It's a perfectly reasonable grouping to make.


> I work on an open team with quite a few women and other folks who would immediately react negatively [...]

No you don't. You're just an attention whore. Or you probably do not interact that much with people, or else you'd know nobody sane would react negatively to some nine headshots of a person. Stop tumultising stupid things.

And Lenna is a good image for testing for various purposes, and it is a nice, beautiful image to see when doing a boring thing like learning an image processing software. And it contains some nice colour work.


They use the same image set on their other popular image library http://fengyuanchen.github.io/cropper/

I find no issue with it and had it open at work. Emma watson is slightly older than myself maybe that's why.


Agreed. I also instinctively closed my tab, and I'm a woman.

Totally unnecessarily sexualized (though very attractive, just not quite appropriate for work!) photos.


The photos in questions are headshots, wearing a hat, with clothes on, smiling or smirking at the camera.

If that's too sexualized for you or your workplace, I'm rather shocked.


Sexuality can be expressed through pose and eyes alone. At least one of the images is lascivious.


100% agree. It's infantile and embarrassing.



This brings up an interesting debate, but I do side with you on this. Feels weird to be at my desk browsing through pictures of Emma Watson.


I wonder if women would have the same feeling of "weirdness"? Personally, I'd initially feel weird because of the possibility of being seen as a man that's "staring" (read:perving) at images of a female at work. Of course, that wouldn't last long, nor would I stand for being called out on it if my actions happened to have been seen by someone willing to complain to me about it.


I find it off-putting as well. It makes it feel more like a creepy corner of reddit than a serious project.

I feel like using an unknown model in the photos would even be an improvement, but still inappropriate.


Agreed. There is a fetishistic element to the grid of sexy Emma Watson photos that is uncomfortable to look at. I'm a woman and a web devleoper. When I look at this plugin's page, I feel immediately uncomfortable and excluded, the photos indicating this is a place for HETEROSEXUAL MEN who will be drawn to this sort of imagery.


Can you elaborate on what you mean by "creepy corner of reddit"?


The images themselves are likely copyrighted. Might be worth finding some public domain images to use in the example.


A martyr without cause. Feel free not to use the plugin if you find the content of its demo page to be morally questionable.


So why did you post on hackernews in a way that would guarantee a flamewar and not just open an issue like a civilized person?

Beware that, when fighting monsters, you yourself do not become a monster... for when you gaze long into the abyss. The abyss gazes also into you.


This is the stupidest thing I've read all week, yet the author of the lib listened to you

I don't get it


If an accord has been reached, then maybe it would be worth understanding. There are plenty of clearly expressed points of view in this thread. If you take the time to read and understand them, it should become clear why the images are bothersome enough to be changed.


This thread is bullshit. The post is about a javascript library. That's it.


neutral things like "flowers" "gardens" "landscapes" or "dessert"... musical instruments, bicycles, buildings, furniture ... why was "sexualized woman" the first thing ... give me a break.


So, the reason we do this is because that's the real audience for imaging.

If you catalog all photos taken, they are mostly going to be of people. And, in particular, attractive photos of women - you won't see men take selfies as much as women do.

This should be your common use case in your software development. Optimize your software for that primary use case first, and then you can worry about other use cases like landscapes or men.


I don't want to be negative put performance is really not that great (specially when pinching), there is simply no comparison to native (massive lag/unresponsive) It's certainly possible to build web native par photo viewers (I've done it) I'll try to open source my implementation soon. However props to the author it seems to have good documentation and well thought out features.


Works great! (btw, here's mine https://github.com/starikovs/stupidbox %-)


I occassionally use PhotoSwipe when I need an image viewer (http://photoswipe.com/documentation/getting-started.html). Bit of a pain to implement, but I really like the way it works both on desktop and mobile and the fact that it has linkable URLs.

For all the over the top options that ViewerJS seems to have, I find it strange that a simple 'click background to close' option is missing.


Tested it for about 30 seconds & found numerous bugs. Scrolling with my Apple Magic touchpad is very buggy. As I scroll up it zooms in 90% of the time, but randomly 10% of the time it reverses the zoom direction so scrolling up zooms out. When I click on the "zoom out" button on the bottom of the screen, the image zooms out but starts moving off the page, as if the width/height are changed but the left/top aren't updated. This does not appear to be production ready.


Nice.

What seems to be missing is the forward/backward links within each 50% of the image width.


The open animation is way too slow. Not great UX.



There should be X to close the image


Clicking outside the image should close it. That's pretty standard nowadays.


It doesn't for me I had to use ESC.


I've just found out that some users (not hackers) click or tap somewhere if they want to close or do something with it even if they don't know how to interact with it in the next step.


me too, but there's an X in the top right


I believe there is an X to close it but it is in the upper right hand corner of the page not in the upper right hand corner of the image as one would expect.


Its there, all the way at the top right.


Bah, I think my solution looks better, and it's mostly all CSS transitions (simpler) -> http://cache.getlazarus.org/videos/flip-photos.mp4


works great. lots of features. easy to use. I like it.


Ha! I was looking exactly for something like this (Zoom/rotate)

Sweet, I lucked out.


lots of +1 for using emma watson, she is also pretty sideways.

However, i did experience a blocking wait for > 5 seconds "Waiting for http://.." some fusion ads or something. In UX terms, it is quite important that image loading ( -> fullscreen on click) is not blocked.


Bah, I think mine which is pure css transitions is better -> http://cache.getlazarus.org/videos/flip-photos.mp4

And simpler too.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: