Wikipedia:Reference desk/Archives/Computing/2017 June 22

From Wikipedia, the free encyclopedia
Computing desk
< June 21 << May | June | Jul >> Current desk >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


June 22[edit]

Forced crop[edit]

Why some social networks, including Facebook, apply a forced crop of the uploaded avatars? If the size is an issue, wouldn't it be better to just autoresize them pixel-wise? Brandmeistertalk 08:02, 22 June 2017 (UTC)[reply]

Why do you think resizing is better than cropping? There's sites on the web which will resize for you if you like, just type something like 'resize photo' into Google and you find some. Dmcq (talk) 11:20, 22 June 2017 (UTC)[reply]
In these cases I think resizing is better, as it preserves all desired areas, while in cropping you're forced to choose what to include. If I want a crop, I can do it myself. Brandmeistertalk 13:23, 22 June 2017 (UTC)[reply]
One reason might be that cropping will consistently work on all graphics formats and sizes, while resizing can sometimes create artifacts (at least in my experience). Cropping might also require less storage space than resizing, if they only store the cropped image. OldTimeNESter (talk) 14:04, 22 June 2017 (UTC)[reply]
As well as details being lost if it resized then one would also have to choose between bars at the sides or top and bottom because of the different aspect ration. One really needs to allow both cropping and resizing to satisfy most people. One advantage of resizing would be that it could produce a number of versions with the resolution determined by the target device, that takes a bit more support but it isn't too hard to do efficiently with modern browsers.. Dmcq (talk) 14:15, 22 June 2017 (UTC)[reply]
Thanks. Brandmeistertalk 16:27, 22 June 2017 (UTC)[reply]
Do they? When you upload a Facebook avatar you don't have to upload it at some specific size.
I suppose you're complaining that Facebook forces your avatar to be square, instead of taking some rectangular image and just stretching it into the square box. Stretching like that would look really cheazy. People can always tell. And besides, it'll make people look fatter or thinner than they really are, making their face look different. ApLundell (talk) 14:34, 22 June 2017 (UTC)[reply]
I mean you are forced to select a limited area on your avatar with subsequent automatic crop by the website. By resizing I specifically mean autofitting of an entire image. Brandmeistertalk 16:27, 22 June 2017 (UTC)[reply]
But you aren't? I tried 1 minute ago and I can both crop (it needs to be square so cropping is semi automatic depending on the size) and resize (using the slider at the bottom). I have to select a square size thumbnail but I don't even have to keep the profile photo square, there is a skip crop button. (What this means is for both the crop and resize it shows in the thumbnail, but clicking on the profile picture will take you to the original photo. If you don't select it the profile picture will be the same as the thumbnail albeit possibly high resolution including I think upscaling to achieve a minimum res.) I'm using the desktop website so I can't say what the mobile app or website may do but it's definitely not required on Facebook as you implied. Nil Einne (talk) 16:57, 22 June 2017 (UTC)[reply]
BTW, by "avatar", I'm assuming you mean profile picture. If you mean something else, I don't know what since Facebook doesn't have anything else which seems like an avatar. It's possible the pictures shown in other areas (like chat) taken from the profile picture may be more cropped, I never paid much attention. Nil Einne (talk) 16:57, 22 June 2017 (UTC)[reply]
I had a quick look and AFAICS, both the chat and the thumbnail shown in place like next to your name on posts is not further cropped so yeah I'm fairly unsure what you're referring to. Nil Einne (talk) 16:59, 22 June 2017 (UTC)[reply]
It does seem the default option is to crop meaning the resize is not at the far left. Especially I think if it's a photo you are in and Facebook recognises you. Weirdly sometimes the resize bar shows at the far left but isn't, once you drag it it fixes itself. But yeah at least on the desktop site I seem to have no problem no cropping other than needed to be square and as said even that it only for the part shown in must circumstances the actual photo stays the same. The fact that the default is to crop does I presume mean if you don't get the option to resize you're SOL but it's definitely not forced in all circumstances. Nil Einne (talk) 17:06, 22 June 2017 (UTC)[reply]
Final test, the Android app seems to let you crop and resize using a typical mobile interface (pinching to zoom etc). The mobile site on Chrome Android does not seem to let you adjust in any way, you can't even select precisely where the square will be. You can use the desktop site on Chrome Android of course, which lets you adjust resizing (meaning turn off any both direction cropping) but you can't adjust the square (i.e. on direction cropping) due to the inability to drag or at least I couldn't work out how. If you have a browser which lets you do so, I guess it will work. I guess you must be using the mobile site (although weirdly not for wikipedia). Unfortunately mobile sites are often a lot more limited than the apps despite the promises of HTML5, probably not helped by the dominance of Android and iOS. Facebook is one of the better ones (e.g. notifications) but still I suspect they didn't think it was that important since many people probably just accept the default crop-resize option. Nil Einne (talk) 17:32, 22 June 2017 (UTC)[reply]
One final comment, since Facebook is known to roll out different features to different users depending on a lot of different things like geographical location and browser, I can't guarantee that you have the same option available. Still most complaints about this seem to have died out perhaps 2 years ago at least that I found. (It maybe started about 4 years ago when the scale to fit option disappeared?) And I'm not certain the mobile site actually resizes or crops other than to the square by default as I see it suggested as a solution. It sounds like the app has had the option to adjust zooming and cropping for a while when the desktop may have still been limited. Nil Einne (talk) 17:42, 22 June 2017 (UTC)[reply]
Actually reading a bit more I'm not sure how many of the complaints are about cropping in both directions or about forced one way cropping. I.E. the thing which a lot of people seem to be unhappy about is that for a while it sounds like using the desktop site the profile picture was cropped to a square no matter what. (Meaning you wouldn't get a non square image when clicking on it.) Nil Einne (talk) 17:48, 22 June 2017 (UTC)[reply]
It lets me resize just fine. The final image needs to be square, and it won't squish or stretch a rectangular image into a square. But If I start with a square image, it resizes to let me use the whole thing. (This is the web page I'm speaking of. I don't have the official app installed on my phone, so I can't test that.) ApLundell (talk) 19:20, 22 June 2017 (UTC)[reply]

Linking to github files with space in its name[edit]

If I have a file named "README.md" in my Github repo root, I can link to it within Github using the syntax:

   [my file](./README.md)

But sometimes filenames have a space in it, so when I have a file named "foo bar.txt" in the repo root, linking to it fails:

   [a filename with space in it](./foo bar.txt)

How could I make this work? (Other than the ugly workaround of replacing all spaces with underscore for all my files.) Scala Cats (talk) 20:07, 22 June 2017 (UTC)[reply]

The usual answer in Linux is to either enclose the filename with quotes, or to escape the space with \. I don't know if either of these will work with Github, however. OldTimeNESter (talk) 23:04, 23 June 2017 (UTC)[reply]