Files
perl-Image-Scale/perl-Image-Scale.spec
2025-08-12 18:14:45 +02:00

92 lines
3.1 KiB
RPMSpec

#
# spec file for package perl-Image-Scale
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define cpan_name Image-Scale
Name: perl-Image-Scale
Version: 0.140.0
Release: 0
# 0.14 -> normalize -> 0.140.0
%define cpan_version 0.14
License: GPL-1.0-or-later
Summary: Fast, high-quality fixed-point image resizing
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/A/AG/AGRUNDMA/%{cpan_name}-%{cpan_version}.tar.gz
Source1: cpanspec.yml
Source100: README.md
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Test::NoWarnings)
Requires: perl(Test::NoWarnings)
Provides: perl(Image::Scale) = %{version}
%undefine __perllib_provides
%{perl_requires}
# MANUAL BEGIN
BuildRequires: libjpeg8-devel
BuildRequires: libpng16-compat-devel
BuildRequires: libpng16-devel
# MANUAL END
%description
This module implements several resizing algorithms with a focus on low
overhead, speed and minimal features. Algorithms available are:
GD's copyResampled (floating-point)
GD's copyResampled fixed-point (useful on embedded devices/NAS devices)
GraphicsMagick's assortment of resize filters (floating-point)
GraphicsMagick's Triangle filter in fixed-point
Supported image formats include JPEG, GIF, PNG, and BMP for input, and JPEG
and PNG for output.
This module came about because we needed to improve the very slow
performance of floating-point resizing algorithms on platforms without a
floating-point unit, such as ARM devices like the SheevaPlug, and the
Sparc-based ReadyNAS Duo. Previously it would take many seconds to resize
using GD on the ReadyNAS but the conversion to fixed-point with a little
assembly code brings this down to the range of well under 1 second.
GD is also incredibly difficult to build on platforms such as Windows so we
needed a replacement.
Normal platforms will also see improvement, by removing all of the GD
overhead this version of copyResampled is around 3 times faster while also
using less memory.
The fixed-point versions have an accuracy to around 4 decimal places so the
quality of floating-point vs. fixed is essentially identical.
%prep
%autosetup -n %{cpan_name}-%{cpan_version}
%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%make_build
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%doc Changes README README.win32 TODO
%changelog