Files
perl-Image-Scale/perl-Image-Scale.spec

90 lines
3.0 KiB
RPMSpec
Raw Normal View History

#
# spec file for package perl-Image-Scale
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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/
#
Name: perl-Image-Scale
Version: 0.14
Release: 0
%define cpan_name Image-Scale
Summary: Fast, high-quality fixed-point image resizing
License: GPL-1.0-or-later
Group: Development/Libraries/Perl
Url: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/A/AG/AGRUNDMA/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Test::NoWarnings)
Requires: perl(Test::NoWarnings)
%{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
%setup -q -n %{cpan_name}-%{version}
%build
perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
make %{?_smp_mflags}
%check
make test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%defattr(-,root,root,755)
%doc Changes README README.win32 TODO
%changelog