Index: /issm/trunk-jpl/src/m/miscellaneous/converttopowerof2.m
===================================================================
--- /issm/trunk-jpl/src/m/miscellaneous/converttopowerof2.m	(revision 19949)
+++ /issm/trunk-jpl/src/m/miscellaneous/converttopowerof2.m	(revision 19950)
@@ -19,8 +19,12 @@
 	width=2^nextpow2(width); length=2^nextpow2(length);
 
+	%make sure the width and length are < 2000: 
+	if width>2^11, width=2^11; end
+	if length>2^11, length=2^11; end
+
 	%convert image to that size: 
 	setenv('DYLD_LIBRARY_PATH','/opt/local/lib:/usr/lib');
 	
-	[status,result]=system(sprintf('convert %s -resize %ix%i %s',tiffname,width,length,pngname));
+	[status,result]=system(sprintf('convert %s -resize %ix%i! %s',tiffname,width,length,pngname));
 	system(sprintf('rm -rf %s',tiffname));
 
