๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.test
Article #282

Re: [convert] -strip -quality 95

#282
From: Michael Uplawski
Date: Sat, 05 Dec 2026 08:11
44 lines
2040 bytes
Le Sat, 5 Dec 2026 06:07:53 -0000 (UTC), Michael Uplawski a รฉcritย :

> Nix zu tun am Samstag

Shining II

#!/bin/env ruby
require 'mini_magick'
require 'base64'
require 'tempfile'

begin
  image = MiniMagick::Image.open(ARGV[0])
rescue Exception => ex
  puts 'ERROR! Cannot open input image: ' << ex.message 
  exit false
end

image.format('png')
image.combine_options do |img|
  img.resize "48x48"
  img.gravity 'center'
  img.background 'none'
  img.quality '95'
  img.extent "48x48"
  img.dither.+
  img.colors 8
  img.strip
end
begin
  #png='/tmp/face.png'
  png = Tempfile.new
  image.write png
rescue Exception => ex
  puts "ERROR! Cannot write output image" << ex.message
  exit false
end

b64 = Base64.strict_encode64(File.binread(png))
puts b64
puts "INFO: PNG was " << File::size(png).to_s

-- 
Eine Schwalbe soll nicht mit Steinen werfen!
Technical Details
Message-ID: <pan$f3027$2e0b768b$94ed6d54$3628db6f@uplawski.eu>
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!.POSTED!not-for-mail
References: <pan$e593b$90149014$4c039ab9$c0793ad2@uplawski.eu>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-mo.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!.POSTED!not-for-mail
From: Michael Uplawski <michael.uplawski@uplawski.eu>
Newsgroups: de.test
Subject: Re: [convert] -strip -quality 95
Date: Sat, 5 Dec 2026 08:11:26 -0000 (UTC)
Organization: MB-NET.NET for Open-News-Network e.V.
Message-ID: <pan$f3027$2e0b768b$94ed6d54$3628db6f@uplawski.eu>
References: <pan$e593b$90149014$4c039ab9$c0793ad2@uplawski.eu>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 5 Dec 2026 08:11:26 -0000 (UTC)
Injection-Info: gwaiyur.mb-net.net;
	logging-data="2716693"; mail-complaints-to="abuse@open-news-network.org"
User-Agent: Pan/0.165 (Kostiantynivka)
Cancel-Lock: sha1:ALCZ9nNQwRPzjQ3/j6Nxcmyyh+E= sha256:vu81/2lX4z9w3HMsv3scEPmlkanmsuFi+Xuxj91YDm0=
	sha1:M7gaQ+Va6MhxfP6UDCM1nRRNy4w= sha256:XwBg8lbJK4lPcwDG+Io6kxm56mX75LcsDyzjADEQDXE=
X-Face: 0]Gu<O&uhv==Rn6(NfJMk+Dt(\Hq-p/suaCU,F3M,l&?Pco/G<lM*M~jljbZi={q
 };>9c<i KvCKE<+{>|fa9qBKv$$TDMXCiD@9kb0A~/s