#dev 2022-03-14

2022-03-14 UTC
#
GWG
[snarfed]: But how does it calculate it? I should look
e-snail, angelo, benji and [aciccarello] joined the channel
#
[aciccarello]
@GWG from Chat:
#
[aciccarello]
I just used exiftool today to bulk set gps locations on images
#
[aciccarello]
This is what I've been doing for setting all the photos in a folder to the same location:
#
[aciccarello]
`exiftool -XMP:GPSLatitude=33.097440 -XMP:GPSLongitude=-116.995723 .`
[jeremycherfas] joined the channel
#
[jeremycherfas]
I've been impressed and pleased by Photo Mechanic’s reverse geocoding tool for phone photos. Adding latlong to “proper” photos using Compass would be cool if I could integrate it easily. Good project to work on.
mro, shaunix[d], justAstache, benji, kloenk, KranNaut and tetov-irc joined the channel
#
GWG
I'm not sure how I envision such a script working.
[jgmac1106], jacky, mro, Ramon[d], whatisthis, sayanarijit[d], hepphepp[d], ancarda, capjamesg, srushe, [tantek] and [schmarty] joined the channel
#
Loqi
[jasonbosco] Phrase searching using quotes is available in `0.23.0.rc42`. If you replace the version numbers on the [downloads page](https://typesense.org/downloads/) with this RC version number, you should be able to get the Docker Image or DEB package. ...
mro joined the channel
#
jacky
oh niceeee
#
jacky
ah that's exciting :)
[manton], mro, gRegor, barnaby, [tw2113_Slack_], cygnoir[d], jamietanna[m], [KevinMarks], jamietanna, P1000[d] and jamietanna1 joined the channel
#
angelo
good to know! sknebel++
#
Loqi
sknebel has 10 karma in this channel over the last year (39 in all channels)
#
Seirdy
been thinking about adding a recommendation to the h-card page on u-photo, to keep u-photo's size low (preferably under 100kb).
#
Seirdy
since it could end up being extracted onto a page with many u-photos (e.g. chat-names, the indieweb webring, an aggregator, etc).
#
Seirdy
their sizes add up
#
barnaby
Seirdy: getting srcset parsing support implemented could be part of a solution to that, but IMO most mf2 consumers should be fetching images and scaling them as appropriate
#
barnaby
or using a proxy
#
Seirdy
so perhaps yet another recommendation to make sure photos look good when scaled up/down to a variety of resolutions, from 32x32 to 512x512
#
barnaby
yep, or using srcset to suggest different images for use at different sizes
#
Seirdy
well we shouldn't recommend using <img srcset> or <picture> until the mf2-parsing spec incorporates them and an implementation or two rolls out.
#
Seirdy
until then, we should recommend using a single image that looks good at a variety of sizes.
#
[tantek]
or better yet a hybrid approach, use whatever img/srcset/picture markup gives your visitors a better experience on your site, and then provide the "best you can do today" microformats markup within that
#
[tantek]
and then we can look at that gap between what site viewers experience, vs the "downlevel" data from the mf2 of the page, and analyze it with the actual img/srcset/picture markup to see what the potential could be if more/all of that srcset/picture markup were parsed into the mf2 results
#
barnaby
yeah exactly, using srcset/picture to improve page weight now has immediate positive gains, and is future-proof for whenever we decide on and implement mf2 parsing support
#
[KevinMarks]
You can do srcset with img fallback I think
#
Seirdy
[KevinMarks]: srcset is part of img already
#
Seirdy
<img srcset="..." sizes="..." src="...">
#
[KevinMarks]
Right, so you have a src and a srcset so the mf2 parse ok
#
barnaby
yep, I do that on my site. <img> with src and srcset attributes
#
Seirdy
combining <img srcset> and <picture> is where things get tricky
#
barnaby
in what circumstances would you combine the two?
#
Seirdy
if each <source> in the <picture> has srcsets and sources vary depending on media queries for prefers-color-scheme and supported image formats, you could easily end up with 12+ different image files for a single <picture> element.
#
barnaby
that sounds like a nightmare
#
Seirdy
i already juggle 6 at a time on my site; dark/light mode, AVIF/WebP/PNG. 6 in all.
[chrisaldrich] joined the channel
#
Seirdy
just one size
#
Seirdy
if i introduced two resolutions, it'd be 2*3*2=12 images per <picture>
#
barnaby
til that <source> can have srcset
#
Seirdy
srcsets are suggestions while <source media=""> is a mandate.
#
Seirdy
my personal philosophy is "make the image as small as you can until the information you wanted to convey would be lost by further shrinkage".
#
Seirdy
if you can, just srcsets for resolution and <picture><source>...</picture> for media queries unrelated to resolution or viewport size, unless you *know* exactly what the right image to pick is for each given resolution+DPR.
#
Seirdy
in which case you can use <picture> for everything
#
barnaby
huh I somehow missed the sizes attribute when I was getting srcset working on my site. Firefox seems to be able to pick the correct image to use anyway, based on my testing
#
barnaby
I get why <picture> can be useful, but I’ve never had any reason to use it myself
#
barnaby
would a mf2 parsing algorithm for srcset need to support the sizes attribute too?
#
Seirdy
TLDR: srcset is for different resolutions for a given image, and <picture>+<source> is for different images altogether. <picture> is good for using next-gen formats and a dark/light/high-contrast/low-contrast variant
#
barnaby
it seems to be more specific to the way the image is presented on the original site, which might not apply to re-use
#
barnaby
Seirdy: by different resolutions, are you talking about different sizes, or strictly different DPI?
#
Seirdy
i'd assume that the client should "know" what sizes to look for ahead-of-time
#
Seirdy
barnaby: either
#
Seirdy
well, not viewport size
#
barnaby
ah okay, that fits with my usage of it then
#
Seirdy
image width or pixel density, or both
#
Seirdy
for viewport size, that's a media query for the current page: use <picture>.
#
Seirdy
now that jpeg-xl is rolling out, we could end up with 16 images for a <picture> element
#
Seirdy
at some point, the size of the markup will outweigh the size savings on using a lower-res image
#
barnaby
sounds like a lot of work for simple personal site usage
#
Seirdy
well once jpeg-xl and webp2 come out, we can ditch AVIF and WebP and stick to a fallback PNG
#
Seirdy
barnaby: i mean i automatically automatically generate these with a shell script and hugo shortcodes.
#
Seirdy
so it's not much work.
#
Seirdy
if i wanted i could make it fully automatic using hugo's image processing but i like to make sure each image is as small as possible at the minimum acceptable quality.
#
barnaby
ah yeah that’s an advantage of static site workflows
#
barnaby
wonder how long it’ll take for imagick to support these new formats
#
Seirdy
WebP2 will obsolete both AVIF and WebP. AVIF is such a broken image format; its lossless mode is completely useless and is typically beaten by WebP or even PNG+Zopfli, since its encoders are designed for lossy compression of animated content. WebP2 incorporates AV1's lossy algos but uses its own lossless algos, just like WebP did with vp8 (lossy) + its own lossless format.
#
barnaby
and for current versions of imagick to become available on shared web hosts
#
Seirdy
barnaby: probably not too long since these encoders are built with good C APIs
#
Seirdy
ImageMagick already supports JXL
#
barnaby
oh cool
#
Seirdy
JXL obsoletes WebP but not AVIF, since the lossy compression works quite differently
#
Seirdy
AVIF removes detail while JXL introduces artifacts
#
Seirdy
which makes them better suited for different tasks
#
Seirdy
essentially, in the distant future: for lossless compression, make a JXL and WebP2 and pick the smaller one; for lossy compression, decide if you want to remove detail or introduce artifacts, then pick WebP2 or JXL acordingly. then make a PNG or JPG to support legacy clients. Repeat for dark mode if your image is really bright. If your image is huge, repeat for a smaller size and use srcsets
#
Seirdy
no need for webp or avif; Apple devices can just use PNG and JPG.
#
Seirdy
Apple might support a new open format by 2040 lmao
#
Seirdy
apple is allergic to open formats; i don't think iOS supports any royalty-free video formats since GIF
#
Seirdy
(except for webrtc which doesn't count)
#
barnaby
calling GIF a “video format” is a bit of a stretch!
#
Seirdy
it's your only option for royalty free raster animation on Fruit Company mobile devices
#
barnaby
brings back memories of my first ever (pre-youtube) website, where I tried to upload five minute long films as animated GIFs because the website builder didn’t support movie files
#
barnaby
this article looks like a good overview of the next-gen image codecs, with a big comparison table at the end https://cloudinary.com/blog/time_for_next_gen_codecs_to_dethrone_jpeg
#
Seirdy
no theora, no vp8, no vp9, no av1. they just have "experimental" vp9 decoding support that they only enable for WebRTC
#
Seirdy
barnaby: the only overview you need is "JXL or WebP2 tomorrow; AVIF and WebP today." atl in the context of web browsers
#
Seirdy
and always use a png/jpg fallback for legacy clients
#
Seirdy
JP2 died before it lived, and HEIC is patent encumbered with royalties making it DOA for Web content (or for anywhere on my machine if I can help it)
#
Seirdy
WebP isn't exactly a "next-gen" format tho it isn't a "legacy" format either. Even Safari on iOS supports WebP, including animated webp. lossless animated webp honestly may never be dethroned
#
Seirdy
this animated webp is from a screen recording i made to demo my approach to open images from image-urls in the terminal: https://seirdy.one/misc/image-handling.webp
#
Seirdy
without a moving cursor, mpdecimate removes almost all frames leaving the result at 4-8 fps.
#
Seirdy
lossless animated webp is perfect for this; it's even smaller than the AV1 video encoded with libaom.
#
barnaby
firefox seems to have some UX issues with it unfortunately, it played once and I can’t rewind it. it’s stuck on the last frame even when I refresh the page
#
Seirdy
barnaby: it's an animated image format, and i don't think it loops without an html attribute.
#
Seirdy
it should restart on refresh tho
#
barnaby
I’d expect it to start again from the beginning when I refresh the page though, although that’s clearly a FF issue
#
Seirdy
srsly tho, <img> should support video srcs for videos to play with image-like semantics and a lack of controls.
#
Seirdy
just tested in FF; it works on my machine (TM).
#
Seirdy
webkit supports video files in <img>. for once, webkit did something right.
#
Seirdy
s/webkit/webcore/
#
barnaby
on my machine it’s handled super weirdly, even refreshing while its playing doesn’t interrupt playback, and opening it in a new tab loads it at the same frame as the previous tab
#
Seirdy
webkit's javascriptcore is fine, it's webcore that's a mess.
#
barnaby
ugh, time to report more FF bugs I suppose
#
Seirdy
barnaby: this could be an issue with a distro package
#
Seirdy
try it in an official build, those use vendored deps and a different toolchain.
#
barnaby
I’m on mac os, so I don’t think I have much choice in that regard?
#
Seirdy
oh i forgot non-linux/bsd operating systems existed
tetov-irc joined the channel
#
Seirdy
most people i chat with online use those, easy to forget that there exist other OSes too.
#
barnaby
I know the feeling, I recently borrowed a gaming PC and was reminded that windows exists
#
Seirdy
wishes QEMU+KVM was as bulletproof as Hyper-V but as nice to use as bhyve
#
barnaby
I’d be in favour of <img> supporting video formats if browsers also allowed right click -> show controls everywhere