-
tomman
-
tomman
(images render fine on FF91ESR)
-
tomman
brr.fyi in fact, many of the photos on this blog render upside down in SeaMonkey
-
njsg
I smell CSS
-
njsg
given that "view image" renders them correctly
-
njsg
... no, that's at the http level, no CSS involved
-
franstam
same, pictures render upside down in pale moon
-
WG9s
franstam: Ibet thisis pictures taken froma cellphone and depending on wich orientationyou had the phone in the actual image might be upside down but is something in the metadata for the image file that tells you how to l it to account for this we seem to incorrectly ignoring.
-
WG9s
franstam: I bet this is pictures taken from a cellphone and depending on which orientation you had the phone in the actual image might be upside down but is something in the metadata for the image file that tells you how to account for this we seem to be incorrectly ignoring.
-
tomman
Mind you, not all pics render upside-down, just some (and yes, the blog author is using a cellphone, but from the screenshots I've seen it's not an iPhone)
-
tomman
but weirdly enough, Modern Browsers™ do render them OK, so may be some EXIF shenanigans then?
-
WG9s
so pictures taken with the camera on top if you havethe phone hoizontal will be right side up if camera is on the bottom might be upside down and anything using the front facing camera will be mirror imaged
-
WG9s
to,mman does not matter depens on which way you hold the camera if you have the camera upside down then pic will be upside dows but I bet there is meata data that says image should be dliped vertically which we ignore.
-
tomman
I should bring that theory to test with my cellphones, would be a interesting experiment indeed
-
WG9s
if camera is in top left when you take tha shot I bet it displays correclty if the camera is in bottom right I bet it dispalys upside down
-
tomman
take photos, load on SeaMonkey, check
-
WG9s
my guess is also that the person whose blog thes pictures are on is left handed bcause he takes pictures woth the pne on bottom firght becuase that makes the wcontrols be on the left.
-
franstam
if u download the pics lemme check the exif info is that possible?
-
WG9s
i am just guessing here I would have no idea what to look for
-
WG9s
but i know i can take pictures with my phone in what I would consider to be upside down but the phone reveres the image so it looks ok when I take the picture but I bet those would be what we render upside down
-
frg_Away
WG9s if you pick the orginal url not upside down so something website
-
WG9s
there must be something we are ignoring that says invert this image verticaly for display
-
franstam
aha.... i download the image, and disable auto image flip using exif info, and the image is upside down
-
franstam
lol seems we are onto something here
-
WG9s
frg_Away: but then that does not esplain wy it displays correctly with latest firefox.
-
WG9s
so seems issue is we do not support auto image flip
-
tomman
-
tomman
download, open with a standalone viewer, renders OK
-
tomman
EXIF metadata says: Orientation: down-right
-
tomman
...my Alcatel cellphone doesn't tag orientation
-
WG9s
tomman: so seems if camera is down right image shows upside down so we ignore the metadata orientation
-
tomman
it seems so
-
tomman
that means sometime in the future, Mozilla started obeying EXIF orientation metadata
-
WG9s
probably a later mozilla patch we need to take to fix this or perhaps a later third party image decoder
-
tomman
OK, my Redmi Note 11 indeed uses EXIF orientation tags
-
tomman
a normal image says Top-left
-
WG9s
so I guess we do things fine if camera is at top edge of the orintation we used to take the picture otherwise it is shown incorrectly
-
WG9s
and for things taken on an iphone for videos issue is if camera is on the top volume controls are on the bottom so perhaps inaccessible during the video because of camera stand.
-
WG9s
so if you orient the phone so you can get to audio controls the entire video might end up upside-down.
-
WG9s
aAAAAAAAAAAAAAAAAAA
-
WG9s
Thank you Beela for your input!
-
frg_Away
-
frg_Away
-
tomman
oooh, it's SeaFox indeed
-
tomman
it enforces a margin and aligns images to the left
-
tomman
Old Default Image Style not only counters that, it also let you customize backgrounds, and even abuse it to inject custom CSS
-
tomman
and it works fine except that sites enforcing CSP break it, and that addon has been unmaintained for nearly 8 years
-
tomman
and from SeaFox addon page:
-
tomman
"- Old Default Image Style: Sea Fox uses a different method to restore the old top level images look."
-
tomman
doesn't help that Sea Fox development also ended years ago
-
tomman
options: either fix Old Default Image Style to deal with CSP crap (I really like my margin and white backgrounds!), or fix Sea Fox to actually center images (also OK)
-
tomman
...found it
-
tomman
it's not even JavaScript but CSS!
-
tomman
seafox/chrome/skin/TopLevelImageDocument.css
-
tomman
that's the one that fixes the background color, adds the margin... and forces the stupid left alignment
-
tomman
now I have two possible courses: 1) kill those and rebuild the addon, or 2) counter a hack with another hack: what about userChrome.css?
-
tomman
oh, it's not userChrome but userContent.css, D'OH!
-
njsg
tomman: 3) make an addon that overrides TopLevelImageDocument.css with your hacks (or perhaps that's 1)?)
-
tomman
I'm kinda close to it
-
tomman
if I disable a couple rules (text-align:right, position: static), I get centered images but lose the margin I want
-
njsg
oh, it's resource://, not chrome://, so IIRC not overridable :-(
-
njsg
how's the margin you want?
-
tomman
8px is enough
-
tomman
wat, I can't override it with userContent?
-
tomman
not even if I use !reallyImportantAndIMeanIt? :D
-
njsg
no, I was saying that for an extension
-
njsg
chrome.manifest has an override directive, but it doesn't work with resource://
-
tomman
in the case of Sea Fox, it overrides resource://gre/res/TopLevelImageDocument.css with chrome://global/skin/media/TopLevelImageDocument.css
-
tomman
the naive option would be to zap the contents of the latter
-
tomman
injecting CSS elsewhere requires dealing with CSP crapola
-
tomman
but... Palefill does deal with CSP crapola
-
njsg
override chrome://global/skin/media/TopLevelImageDocument.css chrome://seafox/skin/TopLevelImageDocument.css
-
njsg
(from the seafox chrome.manifest)
-
njsg
(that's a different file than the resource: one, isn't it?)
-
tomman
gah, this CSP junk is way over my paygrade :D
-
tomman
(also Palefill deals with SCRIPTS, not stylesheets)
-
tomman
but really the proper way would be to fix Old Default Image Style, as it actually allows for customizing stuff
-
tomman
And here comes to Ye Olde Centering Junk On CSS aka "Welcome to Hell"
-
tomman
you're supposed to place your element to be centered (that is our <img>) inside a <DIV> or something else
-
tomman
a <img> inside a <body> won't do because HTML GAAAAH!
-
tomman
I can get my image centered with just position:absolute, margin: auto, and top/left/right/bottom: 0, but lose the margin
-
tomman
with padding I can get the margin and keep things centered, but then I introudce unwanted scrollbars
-
tomman
at this stage it has become your traditional CSS challenge
-
tomman
...and now I've just discovered the joys of CSS flexbox!
-
Tobin
why aren't all the directory provider directories simply mapped to resource uris.. that way simple read doesn't require using the dir provider service
-
Tobin
i mean other than the issue with the resource uri
-
Tobin
but they could map it into the chrome url as well
-
tomman
GAAAAH CSS!
-
tomman
I can center my image perfectly in so many ways, but not with a border
-
tomman
either at least one of the borders gets eaten, or I get scrollbars instead of image+border fitting to height
-
tomman
why the W3C hates centering stuff so hard?! This shit is not new, y'know...
-
tomman
Anyway it seems I gonna give up on the margin idea, as I value more centering than padding/margin/border/whatever
-
njsg
any chance you could set margin and border on body, not img?
-
njsg
ah, I see, that probably is only possible without position: auto
-
njsg
-
njsg
seems to get rid at least of the scrollbars when I use width: 100%; height: 100%
-
tomman
njsg: OK, border-box seems to indeed help!
-
tomman
So basically here is what I got so far:
-
tomman
1) forget about messing with <body>, no CSS flex, no width/height set
-
tomman
2) Leave the default centering stuff on built-in TopLevelImageDocument.css (text-align: center; position: absolute; margin: auto; top/right/left/bottom: 0) since that actually works for centering
-
tomman
3) Add a fake transparent border to <img> and set box-sizing: border-box;
-
tomman
now need to figure out where to place all this: either hijack Sea Fox's TopLevelImageDocument.css (since it has some weird ideas there), or abuse !ReallyImportantAndIMeanItOrElseTaiwanBlowsUp on userContent.css
-
tomman
had to go the way of editing Sea Fox's TopLevelImageDocument, of course
-
tomman
doing stuff the userContent.css would break the Internet in very... artistic ways
-
tomman
now I get my centered images plus margins, save for a marginal case *ba-dum-tss*
-
tomman
if the image is ALMOST the size of the viewport, the browser won't let me zoom it out or in at all
-
tomman
and I lose like half of my top border (I ended with 16px, lose like 8 pixels) for whatever weird reason
-
tomman
for all other cases it works OK
-
tomman
I still insist that the proper way would be fixing Old Document Image Style to cope with CSP, but that's a hell I'm not THAT interested to get into
-
tomman
at least not without good help, and a exorcism or two!
-
tomman
Regarding the flipped images on brr.fyi: while messing with my image margin stuff, I noticed something
-
tomman
if the image is opened in a standalone tab, browser applies image-orientation: from-image (from resource://gre/res/TopLevelImageDocument.css)
-
tomman
but on the blogpost that rule appears nowhere on the default stylesheets
-
njsg
yes, the default used to be something else and was changed to be from-image in
bug 1607667
-
tomman
"Chrome is shipping the change to make from-image the initial value in Chrome 81
twitter.com/argyleink/status/1214616780200562690 so now may be a good time for us to make that change too."
-
njsg
not sure it's that, could be something else, but at least sounds like it could be that
-
tomman
the very first comment depresses me
-
njsg
one moment
-
tomman
there was also a site compatibility note that now links to a dead website
-
njsg
I'll quote again «The only consolation is that, someday, the spec will become the standard and stop changing.» from
marc.merlins.org/htmlearn/netscape/tables.html
-
tomman
"It turned out Chrome 81 already shipped this change (and broke Slack) so there’s no reason for Mozilla to stop shipping."
-
tomman
heh, a change broke broken web junk, lovely~
-
tomman
I guess I'll be adding image-orientation: from-image; to my userContent.css in the meanwhile~
-
njsg
if that is the problem, then img {image-orientation: from-image;} in userContent.css would make sense as a workaround. I suppose there are cases where it won't be enough (image-orientation: initial?), but hopefully that's not something used often?
-
tomman
What site would rely on different defaults?
-
tomman
at least I'm not enforcing it via !important, so if a site for whatever weirdass reason wants to flip images on its own, so be it
-
tomman
in any case this was a very weird issue that nobody noticed because it's so niche...
-
tomman
-
njsg
:-D
-
tomman
try explaining that to your bank, that Antarctica are like many separate countries on the same road
-
tomman
wonder if Wells Fargo still run that couple ATMs down there
-
njsg
shouldn't really be a far-fetched idea, they probably already need to have something for bank card transactions across borders, a question is why they didn't have that in this case, but I'm guessing it was too much trouble and this was the solution people running services there could deploy
-
hardys
-
hardys
-
tomman
the only one that works is the <img> with explicit image-orientation: from-image; (and in my case, the very first <img> after adding that rule to userContent.css)
-
tomman
everything else ignores both EXIF metadata _and_ the rule, yay~!
-
tomman
FF91ESR does everything right, as expected
-
tomman
"I really think producing JPEGs that use the EXIF orientation is a bad idea. And I worry that importing EXIF orientation as a Web feature adds complexity and will create more problems."
-
CaptainTobin
tomman: i want you to think about your statement that esr91 does everything right
-
tomman
that ship has sailed the day Apple and camera OEMs started using it, dude
-
njsg
tomman: could that be
bug 1650715?
-
njsg
the background-image, not Apple
-
tomman
njsg: this is one of those cases where metadata actually matters
-
tomman
if the metadata says "the image is flipped, unflip it when rendering", then the user agent is supposed to unflip it
-
tomman
I took a photo with my camera, I don't care how the camera stores it as long as it is in standards-compliant formats (and EXIF metadata is clearly part of it), hence I see no point to argument that
-
tomman
display my photo as intended, full stop.
-
tomman
if your tools produce broken images, fix your tools, don't impose more brokenness on web browsers!
-
tomman
at least this was one of the rare cases where the answer isn't "Chrome did it first" :D
-
tomman
no, wait, someone at Google figured out that his/her/its iPhone were generating images that "flipped" on Chrome and Apple sure as hell won't "fix" what it isn't broken
-
CaptainTobin
Meanwhile, at Stately Wayne Manor..