Replies

Jul 3, 2019 6 years ago
Antimoany
is a zoo keeper
User Avatar

(Directed here from a bug ticket) While attempting to install a forum image, I seem to have happened across an odd bug: Most images hosted on toyhouse return "Oh no, that isn't a valid image!"

On my entire toyhouse account, I've managed to find two images which I can safely use. These are: https://file.toyhou.se/images/1293671_9PZfk0dDoVgviZM.png https://file.toyhou.se/images/1293672_fbvREvqNyoU1SM0.png

Invalid images (which otherwise meet the size requirements) include: https://file.toyhou.se/images/15006151_oa8PnCQo5KpTQT5.png https://file.toyhou.se/images/15006274_ooOLR8DQMcVjpng.png https://file.toyhou.se/images/15006274_ooOLR8DQMcVjpng.png https://file.toyhou.se/images/15001909_I5gEURDG46CUVaW.png https://file.toyhou.se/images/15002102_EZwNviOTEFx4Txs.png (524 pixels wide, in case the issue was one of being exactly the maximum size) https://file.toyhou.se/characters/2529850?1532924038 (I'm not surprised this one doesn't work, it's a weird URL) https://file.toyhou.se/images/15008653_mMgeknGlUBdXaZa.png

While some of these are identical images, the files are different - hosted on different characters, to see if a particular character (the host of the only two images I've been able to use) was somehow related. That does not appear to be an issue. The only two images that do work are the only two images I can find that I didn't upload myself (most of the images I have on TH are too large, so I simply can't use them to test this). I'm not sure why this should make a difference, but besides their size, it's the only significant factor I can think of.

I can use the above invalid images if I host them elsewhere instead, for example, on discord, so the issue would appear to specifically be hosting on toyhouse, rather than the image itself. I can also use the images, as hosted on toyhouse, elsewhere, for example on other forums or even on Subeta itself. I'm using toyhouse to host an increasing list of elements on Leare's page with no issue.

As some toyhouse-hosted images do work, I'm unsure of how to begin troubleshooting this. I've gone as far as I can without knowing how the image validation system works, or how widespread this issue is.

It's poor timing, but it's midnight here so I'm going to bed and thus won't be able to respond to questions for several hours.

Jul 3, 2019 6 years ago Official
Bug
User Avatar
Segfault

Thank you for your report! We've deployed a fix. Please give those images another try at your earliest convenience and let us know if it's working now :)

🐝 ☕ bug (he/him) | your friendly neighborhood code wrangler. stay in the loop! join and check out the latest admin post highlights

Jul 4, 2019 6 years ago
Antimoany
is a zoo keeper
User Avatar

The previously invalid images seem to work just fine! Thank you!

I'm curious, can I ask exactly what was wrong?

Jul 5, 2019 6 years ago Official
Bug
User Avatar
Segfault

Sure! As part of our image validation process, we check to make sure the file's MIME type is indeed an image (and not some other type of file, like a video or text document, or something more malicious.)

The MIME type should specify that it's an image. You can see what this looks like on this page that lists valid MIME types (offsite link) - search for "image" on the page to get to the right part of the page. There's a bunch of valid types like "image/png" and "image/jpg".

For some reason, some of the Toyhouse image files don't have the "image" part (so like, they simply specify "png" instead of "image/png"), so I just needed to add that to the MIME types we allow :)

🐝 ☕ bug (he/him) | your friendly neighborhood code wrangler. stay in the loop! join and check out the latest admin post highlights

Jul 5, 2019 6 years ago
Antimoany
is a zoo keeper
User Avatar

Thanks for the explanation, that's truly interesting. I was aware MIME types existed (mostly as a result of various programs telling me they're wrong), but didn't really understand what they were until today.

Toyhouse staff are pretty friendly, I bet if you (or I) told them about this issue they might look into fixing it; but it seems like it's a nonissue for Subeta now, anyway.

Jul 5, 2019 6 years ago Official
Bug
User Avatar
Segfault

I don't use Toyhouse myself, so you're probably in a better position to let them know than I am. I think it's a great idea to let them know, because it's one of those things that won't cause problems most of the time, but can be really subtle when it does, so it's just good to be aware of. If you're curious, "png" is technically an invalid MIME type because"a MIME type always has both a type and a subtype, never just one or the other." - MDN (offsite)

🐝 ☕ bug (he/him) | your friendly neighborhood code wrangler. stay in the loop! join and check out the latest admin post highlights

Jul 5, 2019 6 years ago
Antimoany
is a zoo keeper
User Avatar

I've submitted a ticket on the matter, explaining as thoroughly as possible and including both of the links you provided. I suspect this is an accident rather than ignorance - toyhouse has changed a lot over the past couple of years and the two working images I found were uploaded over three years ago, so that might be why they got the correct MIME type and newer images don't.

Jul 5, 2019 6 years ago
Bug
User Avatar
Segfault

Huh, in that case it sounds like maybe they've already fixed the issue, just not retroactively. Well in any case I'm sure they'll appreciate the heads up.

Anyway, do you have any other questions/concerns before I close this up?

🐝 ☕ bug (he/him) | your friendly neighborhood code wrangler. stay in the loop! join and check out the latest admin post highlights

Jul 6, 2019 6 years ago
Antimoany
is a zoo keeper
User Avatar

Got a short response from toyhouse - they can confirm that this is unintended and they're looking for a fix.

However, no, I have no other concerns regarding Subeta. You can close this one.

Please log in to reply to this topic.