[gdal-dev] PCIDSK Write Endian Fix

Rui-Tao Dong ruitao.dong at gmail.com
Thu Apr 14 17:59:43 EDT 2011


PCIDSK doesn't always write in network order.  I believe that it is
missing a SwapPixel.  Here is a trivial patch against 1.8.0.

--- cpixelinterleavedchannel.cpp~	2011-01-13 21:19:05.000000000 -0800
+++ cpixelinterleavedchannel.cpp	2011-04-13 16:43:36.447932521 -0700
@@ -254,6 +254,8 @@
 /* -------------------------------------------------------------------- */
 /*      Do byte swapping if needed.                                     */
 /* -------------------------------------------------------------------- */
+    if( needs_swap )
+        SwapPixels( buffer, pixel_type, width);
 
     return 1;
 }

Regards,

-- 

	Rui-Tao Dong, Ph.D			Neos Geosolutions
	Principal System Architect		100 Bayview Circle, Suite 300
	(949)885-9979(O)			Newport Beach, CA 92660
	(949)287-1077(M)			rdong at neosgeo.com



More information about the gdal-dev mailing list