MagicJinn / MrBeastify-Youtube

Is your browser experience boring? This extension adds the famous youtuber MrBeast to every thumbnail.
GNU General Public License v3.0
208 stars 87 forks source link

flipped image is 1px too high #4

Open Quinten0508 opened 1 year ago

Quinten0508 commented 1 year ago

Some images, such as 4.png, are 1px too high when flipped horizontally, but appears fine when not flipped.

Flipped image (left and right) and normal image (middle). image

More examples: image image image image

ryantanrk commented 1 year ago

this can be fixed by setting top to 1px when flipped, but it feels more like a hack to me. not sure if there's any better solution

Quinten0508 commented 1 year ago

Did some more poking around. Here's another regular youtube homepage with the flipped mrbeast image being 1px too high: image

The yt-core-image--fill-parent-height class (applied to yt-image, the thumbnail itself), adjusts the image height from 201.983 to 202.483, making the image exactly 0.5px taller. However, the mrbeast image already has this new height. The dimensions of the youtube thumbnail and the mrbeast overlay image are exactly the same, yet in the browser the thumbnail is taller than the mrbeast image. Could be a rounding error? This is beyond me though.

image

I've replaced the mrbeast image with a 1280x720 black square (https://i.imgur.com/O8QSi3z.png) and applying top: 1px would be "incorrect". You'll get the same 1px gap, but now on the top of the thumbnail. Replaced image: image

Replaced image with top: 1px: image

Other finds:

MagicJinn commented 1 year ago

Personally I am able to reproduce it on Chromium. I truly have no clue what could be causing this to occur, but I'll continue to investigate.