How to convert JPG to PNG on upload (via add_image_size)?

Đã có trọn bộ đề thi thử THPT Quốc Gia 2022 các môn: vip.dethihsg247.com
QUẢNG CÁO: Đổi thẻ cào thành tiền mặt min rút 10k tại đây

I am looking for a way to have one of the additional images sizes saved as PNG. Ideally the PNG-Version would be rendered on upload and defines through add_image_size.

So far I have only found one WP-plugin that has the built in capability of converting JPGs to PNGs (EWWW Image Optimizer) but it does not really provide the functionality I’m looking for.

I know this should be possible through the PHP function imagecreatefromjpeg – but currently I just don’t know where / how to hook that into add_image_size or wherever taht should be hooked in.

I hope somebody has done this before? Any pointers / suggestion appreciated. Thank you!

Xin chào các bạn và quý Thầy Cô. Hãy nhập từ khóa mình muốn vào ô tìm kiếm trên Website để tìm kiếm mọi thứ hoặc trên google các bạn hãy nhập từ khóa + dethihsg247.com để tìm kiếm các bài viết của chúng tôi nhé.
  • Hiện tại chúng tôi có hơn 25 nghìn bài văn mẫu các thể loại.
  • Kho tài liệu, đề thi học sinh giỏi các lớp vô cùng phong phú.
  • Mỗi ngày cập nhật hơn 100 đề thi chất lượng từ các website bán tài liệu lớn.

Tải đề thi VIP với giá siêu rẻ tại Vip.Dethihsg247.Com