So I’m still working on getting the wedding website moved. The next challenge is converting the image converting portion of the site over to .Net core.
For context: as a way to gold plate the site with something that I thought would be a neat project and might optimize the site a little too, I came up with a controller that would detect what browser the user is using and l convert images on the fly to a next gen image that the said browser supports. You know, like webp, jpeg2000, jpeg xr, etc. Plus it would resize the image, fix rotation, and store it to the file system to serve it again if the same request came in again.
Webp and jpeg 2000 were easy enough to do. Webp was super easy cause google seems to be really pushing that format. Makes sense, considering they’re basically entirely in the web business, and the web is essentially half images. JPEG 2000 was a little more difficult. It seems like it’s entirely in the realm of the OSS advocate with little support from any company aside from Mozilla, so the tooling for this is a bit less polished.
But the worst one was jpeg xr, though. I’ve googled long and hard on how to programmatically convert images to jxr, and I found a pretty satisfactory method of doing it for .Net Framework (the presentation framework includes some good methods for doing this). But I have found almost nothing for .Net Core.
The presentation framework isn’t supported in .Net core (and may never be supported in Unix environments). So in order to convert the images, I need to rely on a NuGet package to do this. I found one called Magick.Net, and right now it seems to be the only one that can do this.
So I created a simple console app to test the conversion, and… it works, but it sucks.
The resulting image ends up being almost 4 times the size of the original at the same color depth and resolution, and I can’t seem to adjust the quality of the conversion either to see if I can squeeze it down.
So I’m just gonna say screw it and go with it anyway. To be honest, the only browsers that support that format are IE and the original Edge browser. I’m not even sure the new Chromium Edge will support it, and even if it does, it’s Chromium. It’s going to support Webp anyway, and the compression I’ve seen for that just seems to do better. Not to mention that some blog posts have purported that the format relies on software rendering, which risks slowing down the page. I haven’t seen that too much myself but, eh, just another reason not to use it.
Maybe Microsoft just doesn’t support the format anymore? I don’t know. Just heap it on top of the pile of image formats the web has rejected, along with HEIC.
Anyway, outside of that: I fucking hate the Apple news app. It popped up a notification that (ugh, I hate this term but I don’t have a better word) “triggered” some pretty bad anxiety with me today. There was another vape related death, which made me want to look into it further which just made it worse. Think I’ll lay off the vape for a good long while.