- 12 Posts
- 45 Comments
Funny you call it magic, what actually does the conversion is Imagick.
In my project I have it integrated in the upload process. You upload a PNG/JPG and it does its thing. Since it’s written in PHP (my project), and PHP has an extension to call Imagick, I didn’t need to write any complicated code.
You can see on this page if your programming language of choice has any integration with Imagick.
But there’s always the command line interface. Depending on your process it may be easier to create a script to “convert all images in a folder”, for example.
but 2KB vs 200KB is paltry on even a terrible connection in the 2000s).
You still need to resize the images and choose the right ones (even if only for the device’s performance).
So we might as well do that small extra step and add conversion to the process.
What I really wish is that we could get more browsers, sites, and apps to universally support more modern formats to replace the overly bloated terribly performing and never correctly pronounced animated formats like GIF with something else like AVIF, webm, webp (this was a roughly ~60MB GIF, and becomes a 1MB WEBP with better performance), or even something like APNG…
Isn’t that the users’ fault? And of the websites for allowing those huge GIFs.
Apparently browsers have supported MP4 for a long time.
Even using the highest compression levels, barely any difference. Not worth it
If I understand correctly gzip, brotli and similar are best used to compress text.
Font files also shouldn’t be compressed. A TTF file compresses a bit, but a WOFF2 file will be even smaller than that (and WOFF2 also doesn’t compress well). So might as well use WOFF/WOFF2
For most of the images that I tried you can only see differences with the images side by side. It’s really subtle.
I do have one example for which my config must be bad, compresses a lot but introduces a lot of noise
In case you still can’t load the image, for the largest width the JPG file has 229.9KB, WEBP has 123.5KB, AVIF has 72KB.
I’m working on a project which generates images in multiples sizes, and also converts to WEBP and AVIF.
The difference in file size is significant. It might not matter to you, but it matters to a lot of people.
Here’s an example (the filename is the width):
Also, using the
<picture></picture>
element, if the users’ browsers don’t support (or block) AVIF/WEBP, the original format is used. No harm in using them.(I know this is a meme post, but some people are taking it seriously)
Olissipo@programming.devto Formula 1@lemmy.world•2025 FORMULA 1 ARAMCO PRE-SEASON TESTING [DAY 1] discussion thread2·5 months agoMultiViewer (which is an unofficial program, mind you) does support Linux, but you need to download the installer manually to install and update.
Other than that it works great
Olissipo@programming.devto Formula 1@lemmy.world•2025 FORMULA 1 ARAMCO PRE-SEASON TESTING [DAY 1] discussion thread19·5 months agoThey started blocking access to the F1TV’s website on Firefox…
Funny how everything works like it used to when I use an extension to pretend to be Chrome
Fortunately MultiViewer still works
Olissipo@programming.devOPto PHP@programming.dev•PHP case study: resisting the switch to Scala, Rust, or Go3·7 months agoThe point is evaluating your stack once in a while. Eventually, you may need to switch or it may be worthwhile, even if you can stick with your current stack at a disadvantage.
For an extreme example, WordPress with crap page builders. It may not have been “that bad” when you started with it. But by now its very much worthwhile to switch. You don’t “need to”, but you should.
Back to this post, maybe they really are at that point that slowly switching is worthwhile. At least partially, where it makes the most sense (they mention using some microservices written in Go).
Olissipo@programming.devOPto PHP@programming.dev•PHP case study: resisting the switch to Scala, Rust, or Go4·7 months agoPersonally I doubt I’ll ever reach the switching point. But the trend for PHP devs seems to be switching to Go (when they do switch).
Olissipo@programming.devOPto Symfony@programming.dev•Symfony 7.2 was released - List of new features1·8 months agoI don’t have a favourite new feature, but I’m just learning about the Compound constraint which I’ll definitely put to use in the near future.
I do have a favourite deprecation, of Removing the Default Garbage Collector Probability option. I’ve had weird and spaced out crashes when developing before I knew about this. Apparently this is to remove stale sessions once in a while. According to this comment, Debian based distros already handle it cleanly with a cron job, so I just unset that Symfony setting
Olissipo@programming.devto PHP@programming.dev•Should I create functions for packages/libraries that allow optional parameters to accept null as a value?2·9 months agoAs long as optional parameters are placed last, I don’t see why not.
PHP8’s named parameters lessen the pain of using a function with optional parameters spread around, but I still stick to that rule.
Olissipo@programming.devto Today I Learned@lemmy.world•TIL mass fatality causing "humam stampedes" and "hysterical masses" are myths which shift responsibility from organisers for fatal crowd incidents which "invariably" result from poor organisationEnglish6·9 months agoThis one in South Korea is pretty recent (October 2022).
A special police team conducted an investigation of the disaster within a few days of it occurring, and concluded on 13 January 2023 that the police and governments’ failure to adequately prepare for the crowds, despite a number of ignored warnings, was the cause of the incident.
Olissipo@programming.devto Linux@programming.dev•Am upgrading from thinkpad to framework 16 with amd. Looking for distro reccommendations.3·1 year agoOk, I understand what you meant, thanks.
Basically, after I’ve read all of that, it’s clear as day that security is not a priority on Testing. And while band-aid solutions do exist, it’s simply not designed to be secure.
Yeah, I wouldn’t run it in a production environment.
Olissipo@programming.devto Linux@programming.dev•Am upgrading from thinkpad to framework 16 with amd. Looking for distro reccommendations.1·1 year agoSure, but even in those “few cases” Testing will get them soon.
I did read at some point that Testing may receive security updates later than stable, might be in those cases in which backports come straight from unstable.
Olissipo@programming.devto Linux@programming.dev•Am upgrading from thinkpad to framework 16 with amd. Looking for distro reccommendations.1·1 year agoI don’t recommend going for (Debian’s/Devuan’s) testing (branch) as it targets a peculiar niche that I fail to understand; e.g. it doesn’t receive the security backports like Stable does nor does it receive them as soon as Unstable/Sid does. Unstable/Sid could work, but I would definitely setup (GRUB-)Btrfs + Timeshift/Snapper to retain my sanity.
From https://backports.debian.org/ :
Backports are packages taken from the next Debian release (called “testing”), adjusted and recompiled for usage on Debian stable
So by definition, security backports in stable are present in Testing in the form of regular packages, right?
I remember having some issue like that, but I’m not sure if this was the fix.
Try unchecking “Show desktop notifications when the song changes” on Spotify’s settings (right now it’s under the Display section).
Makes sense, thanks.
To note that there is one positive type of gentrification that has appeared in Portugal. In the interior there are many small villages that are mostly empty and which have been a target for some richer immigrants.
Hotels and Airbnbs too, it’s not an issue when most of the houses are empty anyway.