foxfirefey: A fox colored like flame over an ornately framed globe (Default)
foxfirefey ([personal profile] foxfirefey) wrote in [site community profile] dw_suggestions2009-08-25 10:31 am

Make comment count images specify size

Title:
Make comment count images specify size

Area:
Crossposting

Summary:
The cross post comment count images should specify what size they are in the HTML.

Description:
Because LJ allows people to use image placeholders for images over a certain size, and because the comment count images have no size specified, a placeholder ends up being used for them. However, because different numbers of comments have different image sizes, it becomes tricky to implement since the HTML specifying the size will have be fixed.

This could be fixed by making the image big enough to accommodate the largest possible number of comments and using those numbers.

Pros:

* people using placeholders on LiveJournal will be able to see the comment count without clicking through

Cons:

* The comment count image will always have to be as big as the largest number of comments possible. This makes it bigger and clunkier for more common smaller numbers.
* Easily breakable if we change the image further down the road.

(I am on the fence about this one myself, but want to see what other people think.)

Poll #1092 Make comment count images specify size
Open to: Registered Users, detailed results viewable to: All, participants: 35


This suggestion:

View Answers

Should be implemented as-is.
16 (45.7%)

Should be implemented with changes. (please comment)
4 (11.4%)

Shouldn't be implemented.
1 (2.9%)

(I have no opinion)
13 (37.1%)

(Other: please comment)
1 (2.9%)

cesy: "Cesy" - An old-fashioned quill and ink (Default)

[personal profile] cesy 2009-08-26 10:43 am (UTC)(link)
How big is the largest number of comments possible?

I am probably in favour of this, unless we're talking a six- or seven-digit image when normally it's just one or two digits of comments.

Also, I've never actually seen the images - is there a preview anywhere? Just found one on your LJ, thanks.
Edited 2009-08-26 10:45 (UTC)
zvi: self-portrait: short, fat, black dyke in bunny slippers (Default)

[personal profile] zvi 2009-08-26 04:55 pm (UTC)(link)
Um, 10,000, I think.
yvi: Kaylee half-smiling, looking very pretty (Default)

[personal profile] yvi 2009-08-26 11:06 am (UTC)(link)
* The comment count image will always have to be as big as the largest number of comments possible.

Why? I haven't looked at how it works and haven't seen it in action yet, so I could be horribly wrong, but isn't the image URL different depending on how many comments an entry has? If so, the width and height attributes could also be made to vary.
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2009-08-26 11:09 am (UTC)(link)
The problem is that the page which generates the comment count returns an actual image, and not the URL/image tag for one, which means that even though we know the information, we can't pass it back to the call very easily.
afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)

[personal profile] afuna 2009-08-26 11:07 am (UTC)(link)
Hmm, when we generate the image, we can get the width and height from the object. The problem is passing it back to the caller. I wonder if we could have:

commentcount?user=username&ditemid=12345 returns the generated image
commentcount?user=username&ditemid=12345&info=detailed returns the generated image's dimensions as a hash, which we can use to put the width and height into the image tag text


(but this means two calls each time you try to generate an image tag for a crossposted image -- I'm not sure it's a good idea)
allen: (Default)

[personal profile] allen 2009-08-26 02:01 pm (UTC)(link)
This makes a lot of sense. Making the image size dynamically update looked the best, but I didn't think of the placeholder issue.

We could probably reasonably make the width the size for 4 digits (I think that I used a variable-width font, so probably '9999' or something) and then right-align the number. The rectangle of white will be larger than it was before, but it will still look ok.
kate_nepveu: sleeping cat carved in brown wood (Default)

[personal profile] kate_nepveu 2009-08-26 04:59 pm (UTC)(link)
I don't know the best way to do this, but having it trigger image placeholders on LJ is definitely a problem, so voting for "with changes" where "changes" = "something reasonably elegant."
zvi: self-portrait: short, fat, black dyke in bunny slippers (Default)

[personal profile] zvi 2009-08-26 05:05 pm (UTC)(link)
I really think it would be better to have the image file's size dictated by the number of digits and to return that correctly to the crossposter.

This could be facilitated by changing the image numbers to a fixed width font, so that there would be only five image sizes to account for.
zvi: self-portrait: short, fat, black dyke in bunny slippers (Default)

[personal profile] zvi 2009-08-27 05:20 pm (UTC)(link)
No, you're right. I was thinking that we send a variable to the other server, but we're sending plaintext. :(
moonie: (Default)

[personal profile] moonie 2009-08-27 06:18 am (UTC)(link)
It would also be great if a border=0 property could be added to the img tag for the comment count.
pseudomonas: per bend sinister azure and or a chameleon counterchanged (Default)

[personal profile] pseudomonas 2009-08-27 10:54 am (UTC)(link)
Yes, that'd be useful
pseudomonas: (eyebrow)

[personal profile] pseudomonas 2009-08-27 10:57 am (UTC)(link)
Does specifying the height but not the width help matters any?
pseudomonas: "Cambridge" in London Underground roundel (cam)

[personal profile] pseudomonas 2009-08-27 11:13 am (UTC)(link)
I'd love the effect of this, but the side-effects are too great.

Maybe something to consider instead is giving people who want to have placeholder images the option to whitelist comment-count images from other DW-codebase sites (and also perhaps the ones from wordpress sites and so on).
triadruid: Apollo and the Raven, c. 480 BC , Pistoxenus Painter  (Default)

[personal profile] triadruid 2009-08-28 08:12 pm (UTC)(link)
I much prefer the idea of tweaking the img tag to trying to size all images the same - '3' and '9,758' should not be the same, and it'll be ugly if they are.
aedifica: Me with my hair as it is in 2020: long, with blue tips (Default)

[personal profile] aedifica 2009-09-05 02:13 pm (UTC)(link)
I just did a search to see if this had already been suggested, because I was about to suggest it myself.