]> granicus.if.org Git - postgis/commitdiff
- fixed band count check in st_asjpeg and st_aspng
authorBborie Park <bkpark at ucdavis.edu>
Sun, 22 May 2011 16:06:47 +0000 (16:06 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Sun, 22 May 2011 16:06:47 +0000 (16:06 +0000)
- fixed regression expected output for rt_aspng

git-svn-id: http://svn.osgeo.org/postgis/trunk@7206 b70326c6-7e19-0410-871a-916f4a2858ee

raster/rt_pg/rtpostgis.sql.in.c
raster/test/regress/rt_aspng_expected

index c5a5bb2adc12c356daf6451d62a5c7b0ce50ccdc..a6a21845946b102064775d616676064bb508bdc5 100644 (file)
@@ -1258,11 +1258,7 @@ CREATE OR REPLACE FUNCTION st_asjpeg(rast raster, options text[])
 
                -- JPEG only allows 1 or 3 bands
                -- we only use the first
-               IF num_bands > 3 THEN
-                       RAISE NOTICE 'The JPEG format only permits one or three bands.  The first three bands will be used.';
-                       rast2 := st_band(rast, ARRAY[1, 2, 3]);
-                       num_bands := st_numbands(rast);
-               ELSEIF num_bands > 1 THEN
+               IF num_bands <> 1 AND num_bands <> 333 THEN
                        RAISE NOTICE 'The JPEG format only permits one or three bands.  The first band will be used.';
                        rast2 := st_band(rast, ARRAY[1]);
                        num_bands := st_numbands(rast);
@@ -1343,11 +1339,7 @@ CREATE OR REPLACE FUNCTION st_aspng(rast raster, options text[])
                num_bands := st_numbands($1);
 
                -- PNG only allows 1 or 3 bands
-               IF num_bands > 3 THEN
-                       RAISE NOTICE 'The PNG format only permits one or three bands.  The first three bands will be used.';
-                       rast2 := st_band($1, ARRAY[1, 2, 3]);
-                       num_bands := st_numbands(rast2);
-               ELSEIF num_bands > 1 THEN
+               IF num_bands <> 1 AND num_bands <> 3 THEN
                        RAISE NOTICE 'The PNG format only permits one or three bands.  The first band will be used.';
                        rast2 := st_band($1, ARRAY[1]);
                        num_bands := st_numbands(rast2);
index 460bb9d7d2b67f8eff23cc796e34e328883de1a6..fbb91e0f3039e4077bafa48412b0005ae567d9f0 100644 (file)
@@ -2,11 +2,8 @@ ERROR:  The pixel type of band 1 in the raster is not 8BUI or 16BUI.  The PNG fo
 55279950e29968bcf36b2c11ce8bf88b
 ERROR:  The pixel type of band 1 in the raster is not 8BUI or 16BUI.  The PNG format can only be used with 8BUI and 16BUI pixel types.
 24188762b5745acda4aa7b92776e7280
-NOTICE:  The PNG format only permits one or three bands.  The first band will be used.
 ERROR:  The pixel type of band 1 in the raster is not 8BUI or 16BUI.  The PNG format can only be used with 8BUI and 16BUI pixel types.
-NOTICE:  The PNG format only permits one or three bands.  The first band will be used.
 ERROR:  The pixel type of band 1 in the raster is not 8BUI or 16BUI.  The PNG format can only be used with 8BUI and 16BUI pixel types.
-NOTICE:  The PNG format only permits one or three bands.  The first band will be used.
 ERROR:  The pixel type of band 1 in the raster is not 8BUI or 16BUI.  The PNG format can only be used with 8BUI and 16BUI pixel types.
 dfff54767aad7aa842f45e5b83326f0b
 NOTICE:  The PNG format only permits one or three bands.  The first band will be used.