Hello community,
here is the log from the commit of package ghc-JuicyPixels-scale-dct for
openSUSE:Factory checked in at 2017-04-11 09:37:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ghc-JuicyPixels-scale-dct (Old)
and /work/SRC/openSUSE:Factory/.ghc-JuicyPixels-scale-dct.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-JuicyPixels-scale-dct"
Tue Apr 11 09:37:11 2017 rev:2 rq:483915 version:0.1.1.2
Changes:
--------
---
/work/SRC/openSUSE:Factory/ghc-JuicyPixels-scale-dct/ghc-JuicyPixels-scale-dct.changes
2017-03-24 01:53:48.404552425 +0100
+++
/work/SRC/openSUSE:Factory/.ghc-JuicyPixels-scale-dct.new/ghc-JuicyPixels-scale-dct.changes
2017-04-11 09:37:13.448370685 +0200
@@ -1,0 +2,5 @@
+Thu Sep 15 07:00:53 UTC 2016 - [email protected]
+
+- Update to version 0.1.1.2 revision 0 with cabal2obs.
+
+-------------------------------------------------------------------
Old:
----
2.cabal
JuicyPixels-scale-dct-0.1.1.0.tar.gz
New:
----
JuicyPixels-scale-dct-0.1.1.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ghc-JuicyPixels-scale-dct.spec ++++++
--- /var/tmp/diff_new_pack.9lQp5K/_old 2017-04-11 09:37:14.700193849 +0200
+++ /var/tmp/diff_new_pack.9lQp5K/_new 2017-04-11 09:37:14.704193284 +0200
@@ -1,7 +1,7 @@
#
# spec file for package ghc-JuicyPixels-scale-dct
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 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
@@ -19,16 +19,14 @@
%global pkg_name JuicyPixels-scale-dct
%bcond_with tests
Name: ghc-%{pkg_name}
-Version: 0.1.1.0
+Version: 0.1.1.2
Release: 0
Summary: Scale JuicyPixels images with DCT
License: BSD-3-Clause
-Group: System/Libraries
+Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
-Source1:
https://hackage.haskell.org/package/%{pkg_name}-%{version}/revision/2.cabal
BuildRequires: ghc-Cabal-devel
-# Begin cabal-rpm deps:
BuildRequires: ghc-JuicyPixels-devel
BuildRequires: ghc-base-compat-devel
BuildRequires: ghc-carray-devel
@@ -36,13 +34,14 @@
BuildRequires: ghc-rpm-macros
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{with tests}
-BuildRequires: ghc-JuicyPixels-util-devel
BuildRequires: ghc-time-devel
%endif
-# End cabal-rpm deps
%description
-Scale JuicyPixels Images with DCT.
+Scale JuicyPixels Images with DCT
+
+There is also a 'friday' version:
+<http://hackage.haskell.org/package/friday-scale-dct friday-scale-dct>.
%package devel
Summary: Haskell %{pkg_name} library development files
@@ -58,22 +57,15 @@
%prep
%setup -q -n %{pkg_name}-%{version}
-cp -p %{SOURCE1} %{pkg_name}.cabal
-
%build
%ghc_lib_build
-
%install
%ghc_lib_install
-
%check
-%if %{with tests}
-%{cabal} test
-%endif
-
+%cabal_test
%post devel
%ghc_pkg_recache
++++++ JuicyPixels-scale-dct-0.1.1.0.tar.gz ->
JuicyPixels-scale-dct-0.1.1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JuicyPixels-scale-dct-0.1.1.0/CHANGELOG.md
new/JuicyPixels-scale-dct-0.1.1.2/CHANGELOG.md
--- old/JuicyPixels-scale-dct-0.1.1.0/CHANGELOG.md 2015-11-10
06:16:28.000000000 +0100
+++ new/JuicyPixels-scale-dct-0.1.1.2/CHANGELOG.md 2016-09-07
05:56:26.000000000 +0200
@@ -1,3 +1,11 @@
+# 0.1.1.2
+
+- Make test suite pass, even if `cat.jpg` is absent
+
+# 0.1.1.1
+
+- Remove test dependency on `JuicyPixels-util`
+
# 0.1.1.0
- Bundle missing test file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/JuicyPixels-scale-dct-0.1.1.0/JuicyPixels-scale-dct.cabal
new/JuicyPixels-scale-dct-0.1.1.2/JuicyPixels-scale-dct.cabal
--- old/JuicyPixels-scale-dct-0.1.1.0/JuicyPixels-scale-dct.cabal
2015-11-10 06:41:19.000000000 +0100
+++ new/JuicyPixels-scale-dct-0.1.1.2/JuicyPixels-scale-dct.cabal
2016-09-07 05:56:08.000000000 +0200
@@ -1,11 +1,13 @@
--- This file has been generated from package.yaml by hpack version 0.8.0.
+-- This file has been generated from package.yaml by hpack version 0.14.0.
--
-- see: https://github.com/sol/hpack
name: JuicyPixels-scale-dct
-version: 0.1.1.0
+version: 0.1.1.2
synopsis: Scale JuicyPixels images with DCT
description: Scale JuicyPixels Images with DCT
+ .
+ There is also a @friday@ version:
<http://hackage.haskell.org/package/friday-scale-dct friday-scale-dct>
category: Web
homepage: https://github.com/phadej/JuicyPixels-scale-dct#readme
bug-reports: https://github.com/phadej/JuicyPixels-scale-dct/issues
@@ -13,7 +15,7 @@
maintainer: Oleg Grenrus <[email protected]>
license: BSD3
license-file: LICENSE
-tested-with: GHC==7.8.4, GHC==7.10.2
+tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.1
build-type: Simple
cabal-version: >= 1.10
@@ -31,8 +33,8 @@
src
ghc-options: -Wall
build-depends:
- base >=4.7 && <4.9
- , base-compat >=0.6.0 && <0.9
+ base >=4.7 && <4.10
+ , base-compat >=0.6.0 && <0.10
, JuicyPixels >=3.2.5.3 && <3.3
, fft >=0.1.8.1 && <0.2
, carray >=0.1.6.1 && <0.2
@@ -47,14 +49,13 @@
example
ghc-options: -Wall
build-depends:
- base >=4.7 && <4.9
- , base-compat >=0.6.0 && <0.9
+ base >=4.7 && <4.10
+ , base-compat >=0.6.0 && <0.10
, JuicyPixels >=3.2.5.3 && <3.3
, fft >=0.1.8.1 && <0.2
, carray >=0.1.6.1 && <0.2
, base
- , JuicyPixels
+ , JuicyPixels >=3.2.8
, JuicyPixels-scale-dct
- , JuicyPixels-util >=0.2 && <0.3
- , time >=1.4.2 && <1.6
+ , time >=1.4.2 && <1.7
default-language: Haskell2010
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/JuicyPixels-scale-dct-0.1.1.0/example/Example.hs
new/JuicyPixels-scale-dct-0.1.1.2/example/Example.hs
--- old/JuicyPixels-scale-dct-0.1.1.0/example/Example.hs 2015-11-09
05:28:12.000000000 +0100
+++ new/JuicyPixels-scale-dct-0.1.1.2/example/Example.hs 2016-09-07
05:53:35.000000000 +0200
@@ -1,18 +1,29 @@
module Main (main) where
-import Codec.Picture (readImage, writePng)
-import Codec.Picture.RGBA8 (fromDynamicImage)
+import Codec.Picture (convertRGBA8, readImage, writePng)
import Codec.Picture.ScaleDCT (scale)
import Data.Time (diffUTCTime, getCurrentTime)
+processImage
+ :: String -- ^ From
+ -> (Int, Int) -- ^ Target size
+ -> String -- ^ To
+ -> IO ()
+processImage src size dst = do
+ start <- getCurrentTime
+ eimg <- readImage src
+ case eimg of
+ Left err -> print err
+ Right dimg -> do
+ let img = convertRGBA8 dimg
+ let ava = scale size img
+ writePng dst ava
+ end <- getCurrentTime
+ putStrLn $ dst ++ ": " ++ show (end `diffUTCTime` start)
+
main :: IO ()
main = do
- start <- getCurrentTime
- Right dimg <- readImage "phadej.png"
- let img = fromDynamicImage dimg
- let ava1 = scale (64, 64) img
- let ava2 = scale (600, 600) img
- writePng "phadej-small.png" ava1
- writePng "phadej-large.png" ava2
- end <- getCurrentTime
- print $ end `diffUTCTime` start
+ processImage "cat.jpg" (96, 64) "cat-small.png"
+ processImage "cat.jpg" (769, 512) "cat-large.png"
+ processImage "phadej.png" (64, 64) "phadej-small.png"
+ processImage "phadej.png" (600, 600) "phadej-large.png"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/JuicyPixels-scale-dct-0.1.1.0/src/Codec/Picture/ScaleDCT.hs
new/JuicyPixels-scale-dct-0.1.1.2/src/Codec/Picture/ScaleDCT.hs
--- old/JuicyPixels-scale-dct-0.1.1.0/src/Codec/Picture/ScaleDCT.hs
2015-11-09 06:25:37.000000000 +0100
+++ new/JuicyPixels-scale-dct-0.1.1.2/src/Codec/Picture/ScaleDCT.hs
2016-09-04 20:01:01.000000000 +0200
@@ -12,26 +12,27 @@
--
module Codec.Picture.ScaleDCT (scale) where
-import Prelude ()
+import Prelude ()
import Prelude.Compat
-import Codec.Picture (Image (..), PixelRGBA8 (..), Traversal,
- generateImage, imagePixels)
+import Codec.Picture
+ (Image (..), PixelRGBA8 (..), Traversal, generateImage, imagePixels)
import Control.Applicative (Const (..))
-import Data.Array.CArray (CArray, amap, array, bounds, elems, listArray,
size,
- (!))
+import Data.Array.CArray
+ (CArray, amap, array, bounds, elems, listArray, size, (!))
+import Data.Coerce (Coercible, coerce)
import Data.Ix (inRange, range)
import Data.Monoid (Endo (..))
import Data.Word (Word8)
import Math.FFT (dct2N, dct3N)
-import Data.Coerce (Coercible, coerce)
type Array2D = CArray (Int, Int) Double
-- | Scale the image using DCT transform.
-scale :: (Int, Int) -- ^ Output width, height
- -> Image PixelRGBA8 -- ^ Input image
- -> Image PixelRGBA8 -- ^ Output image
+scale
+ :: (Int, Int) -- ^ Output width, height
+ -> Image PixelRGBA8 -- ^ Input image
+ -> Image PixelRGBA8 -- ^ Output image
scale dim img = fromChannels r' g' b' a'
where
r = channelR img
@@ -51,15 +52,17 @@
imgNorm :: Array2D -> Double
imgNorm ch = sqrt . (/n) . sum . fmap sq . elems $ ch
- where sq x = x * x
- n = fromIntegral $ size ch
+ where
+ sq x = x * x
+ n = fromIntegral $ size ch
cut :: (Int, Int) -> Array2D -> Array2D
cut (w, h) img = array b [ (i, pick i) | i <- range b ]
- where b = ((0,0), (h-1, w-1))
- b' = bounds img
- pick i | inRange b' i = img ! i
- | otherwise = 0
+ where
+ b = ((0,0), (h-1, w-1))
+ b' = bounds img
+ pick i | inRange b' i = img ! i
+ | otherwise = 0
pixelR, pixelG, pixelB, pixelA :: PixelRGBA8 -> Word8
pixelR (PixelRGBA8 r _ _ _) = r
@@ -68,10 +71,11 @@
pixelA (PixelRGBA8 _ _ _ a) = a
extractChannel :: (PixelRGBA8 -> Word8) -> Image PixelRGBA8 -> Array2D
-extractChannel f img@(Image w h _) = listArray ((0, 0), (h - 1, w - 1))
- . map (fromInteger . toInteger . f)
- . toListOf imagePixels
- $ img
+extractChannel f img@(Image w h _)
+ = listArray ((0, 0), (h - 1, w - 1))
+ . map (fromInteger . toInteger . f)
+ . toListOf imagePixels
+ $ img
channelR, channelG, channelB, channelA :: Image PixelRGBA8 -> Array2D
channelR = extractChannel pixelR
@@ -79,18 +83,21 @@
channelB = extractChannel pixelB
channelA = extractChannel pixelA
-fromChannels :: Array2D
- -> Array2D
- -> Array2D
- -> Array2D
- -> Image PixelRGBA8
+fromChannels
+ :: Array2D
+ -> Array2D
+ -> Array2D
+ -> Array2D
+ -> Image PixelRGBA8
fromChannels r g b a = generateImage f w h
- where f x y = PixelRGBA8 (f' r) (f' g) (f' b) (f' a)
- where i = (y, x)
- f' c = truncate (limit $ c ! i)
- (_, (h', w')) = bounds r
- w = w' + 1
- h = h' + 1
+ where
+ f x y = PixelRGBA8 (f' r) (f' g) (f' b) (f' a)
+ where
+ i = (y, x)
+ f' c = truncate (limit $ c ! i)
+ (_, (h', w')) = bounds r
+ w = w' + 1
+ h = h' + 1
limit :: Double -> Double
limit x | x < 0 = 0