17

ATTENTION @dfox!!!!

I found a bug in the devRant REST server. When you upload a rant with a vertical image (when the height is bigger than the width), the server seems to flip between the width and the height (I don't know if it happens all the time), and when I fetch the rant, the JSON data for image width and height is flipped! (in the JSON, the attached image section contains width and height information about the image, and they are flipped in their values, meaning that the width key is equal to the height, and the height key is equal to the width).

An explanation on the image below:

The small window on the left shows the real info about the image. Notice how the height is 800 and width is 600.

The window at the bottom shows the data fetched from devRant servers. Notice how the width returned from the server is 800 and the height returned from the server is 600.

Comments
  • 5
  • 4
  • 14
    Huh. So this might be why some images have been weirdly squashed recently.
  • 6
    @atheist Including every single vertical image I posted on devRant recently as well.
  • 5
  • 4
    Having just looked through my recent up votes, looks like it doesn't happen every time. So might be something a bit odd.

    You can also create an issue on github
    https://github.com/devRant/devRant
  • 13
    I think this is a good feature because it makes pictures funnier. Maybe we should squeeze horizontal pictures also.
  • 3
    If I was gonna guess, I'd say one image format is being converted to another incorrectly, or something is being downsampled incorrectly.
  • 4
    There's also @trogus not sure how active they both are.
  • 2
    @atheist *maybe*.

    I just looked at my API request functions and I noticed that I sent JPEG data with the mimetype "image/png". I don't know if that's the culprit, but I can easily test that now with the same image that appears squashed. I think that when I MITM'd the request for the first time, I think that part really confused me and maybe that fucked it up, but again, I can't be sure, really.
  • 2
    @atheist I changed a really small bit of my code, I will attempt to send an image which is known to be a problematic one for me in just a moment.
  • 3
    This is a test of one of the broken images
  • 4
    @atheist I wasn't expecting my black metal logo rant but thanks 🤗

    Kissies for ya 😘😘🥰🥰
  • 2
    Maybe that was the issue?!
  • 3
    It's also possible that there are conversions to preferred image format/resolution on the back end (reduce cost), so wouldn't be surprised if it was on back end too.

    But is interesting that your image worked.
  • 2
    @Floydimus black gold you mean? 😘
  • 2
    @atheist absolute gold.
  • 1
    @theKarlisK oooooo I like that.

    You guys will make me famous one day.
  • 2
    @OmerFlame WOW the PCB looks great.
  • 2
    Is this swift? looks familiar tho
  • 1
    As if he cares
  • 3
    Thanks - I’m looking into this. Nothing has changed with our image processing in a long time though, but still thinking a few things it could be
Add Comment