Olissipo

joined 2 years ago
[–] Olissipo@programming.dev 4 points 1 day ago* (last edited 1 day ago)

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.

[–] Olissipo@programming.dev 4 points 2 days ago* (last edited 2 days ago) (2 children)

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.

https://caniuse.com/mpeg4

[–] Olissipo@programming.dev 7 points 2 days ago (2 children)

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

[–] Olissipo@programming.dev 2 points 2 days ago

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

[–] Olissipo@programming.dev 1 points 2 days ago

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.

[–] Olissipo@programming.dev 73 points 2 days ago* (last edited 2 days ago) (40 children)

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)

 

June 17, 2025

  • 13:30–19:00 CET/CEST
  • 07:30–13:00 EST/EDT
  • 11:30–17:00 UTC
[–] Olissipo@programming.dev 2 points 2 months ago (1 children)

MultiViewer (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.dev 19 points 2 months ago (8 children)

They 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.dev 3 points 5 months ago

The 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.dev 4 points 5 months ago (1 children)

Personally 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).

 

My TLDR is:

  • Their team was using PHP

  • Before doing a complete re-write they evaluated other languages

  • Rust ruled out due to cost/benefit, being the fastest in the list, but also the most complex

  • PHP kept as the main language because:

    • The ecosystem is mature
    • The PHP/Symfony (and Roadrunner) stack meets their high-performance needs
  • Inertia: their team "already had extensive experience" in it

  • They already integrated Go in some microservices

  • They aren't locked to PHP, and will continue to evaluate these programming languages and others

3
submitted 5 months ago* (last edited 5 months ago) by Olissipo@programming.dev to c/symfony@programming.dev
 

Twig 3.15 was released a few weeks ago and includes an impressive list of new features and improvements. This two-part blog post highlights the most important ones.

Edit: Part 2

[–] Olissipo@programming.dev 1 points 5 months ago

I 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.dev 2 points 7 months ago

As 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.

53
submitted 11 months ago* (last edited 11 months ago) by Olissipo@programming.dev to c/linux@programming.dev
 

The Debian Long Term Support (LTS) Team hereby announces that Debian 10 "buster" support will reach its end-of-life on June 30, 2024, nearly five years after its initial release on July 6th, 2019.

Starting in July, Debian will not provide further security updates for Debian 10. A subset of "buster" packages will be supported by external parties. Detailed information can be found at Extended LTS.

The Debian LTS Team will prepare afterwards the transition to Debian 11 "bullseye", the current oldstable release. Thanks to the combined effort of different teams including the Security Team, the Release Team, and the LTS Team, the Debian 11 life cycle will also encompass five years. To make the life cycle of Debian releases easier to follow, the related Debian teams have agreed on the following schedule: three years of regular support plus two years of Long Term Support. The LTS Team will take over support from the Security and the Release Teams on August 14, 2024, three years after the initial release on August 14, 2021. The final point update release for "bullseye" will be published soon after the final Debian 11 Security Advisory (DSA) will be issued.

Debian 11 will receive Long Term Support until August 31, 2026. The supported architectures remain amd64, i386, arm64 and armhf.

1
submitted 1 year ago* (last edited 1 year ago) by Olissipo@programming.dev to c/wordpress@lemmy.world
 

This might not be new, I hadn't dealt with WordPress/WooCommerce in a while.

Currently (v8.8.2) in a new WooCommerce installation the "Checkout" page is created using blocks, like so:

<!-- wp:woocommerce/checkout-payment-block -->
<div class="wp-block-woocommerce-checkout-payment-block"></div>
<!-- /wp:woocommerce/checkout-payment-block -->

(...)

The problem

This might introduce breaking changes to the plugins and themes you normally use. For example, I couldn't add a new field - programatically or using a plugin.

The fix

Remove the blocks and revert to using the shortcode:

[woocommerce_checkout]

view more: next ›