debian/0000755000000000000000000000000012142247745007176 5ustar debian/changelog0000644000000000000000000002217012142247535011047 0ustar imview (1.1.9c-12) unstable; urgency=low [ Sebastian Ramacher ] * [d79ec89] Fix stack smashing in ics-reader. -- Anton Gladky Tue, 07 May 2013 20:59:00 +0200 imview (1.1.9c-12~exp1) experimental; urgency=low * [f0c3a16] Fix FTBFS on kFreeBSD. * [136138c] Update copyright to DEP-5. * [175de99] Replace libmagick9-dev by libmagickwand-dev in BD. -- Anton Gladky Fri, 08 Feb 2013 20:41:29 +0100 imview (1.1.9c-11) unstable; urgency=low * [8106c00] Fix FTBFS on kFreeBSD*. -- Anton Gladky Thu, 07 Feb 2013 22:06:57 +0100 imview (1.1.9c-11~exp1) experimental; urgency=low [ Sebastian Ramacher ] * [7119f69] Fix dangerous use of strncpy. (Closes: #699912) [ Anton Gladky ] * [fcb4e4c] Bump Standards-Version: 3.9.4. No changes. * [0027d5d] Fix format not a string issue. * [7bd739a] Use dh 9, simplify debian/rules. * [550a408] Use DEP-5 for copyright file, not finished. -- Anton Gladky Wed, 06 Feb 2013 22:54:32 +0100 imview (1.1.9c-10) unstable; urgency=low [ Anton Gladky ] * [f6c935a] Update homepage. (Closes: #681761) * [272f222] Add upstream-files. [ Michael Terry ] * [98e20d5] Prevent link fltk libraries statically. [ Sebastian Ramacher ] * [5832a2e] Fix stack smashing in ics-reader. (Closes: #699820) -- Anton Gladky Wed, 06 Feb 2013 19:46:55 +0100 imview (1.1.9c-9) unstable; urgency=low * [2c68893] Fix FTBFS with gcc-4.7. Thanks to Sebastian Ramacher. (Closes: #678675) * [e2cc2e0] Add myself to uploaders. * [8d1263c] Use Standards-Version: 3.9.3, no changes. -- Anton Gladky Tue, 26 Jun 2012 21:20:36 +0200 imview (1.1.9c-8) unstable; urgency=low * Fix argument type in nbcopies callbacks (closes: #634418). * rules: Add build-arch and build-indep targets. * control: - Upgrade to standards-version 3.9.2. - Require fluid (>= 1.3.0) to build with nbcopies fix. * Add debian/source/options with single-debian-patch option. * Fix spelling of conjuction => conjunction in manpage. -- Teemu Ikonen Fri, 23 Sep 2011 17:22:20 +0200 imview (1.1.9c-7) unstable; urgency=low * imview.desktop: - Remove obsolete Encoding key. - Remove obsolete 'Application' category from Categories. * imview.1: Add a slash escape to '-' chars in manpage to force a correct interpretation as a minus. * copyright: Fix file reference to GPL-2 * Fix various string typos reported by lintian. * Remove topgit junk. * rules: Remove configure.in dependency from configure.original -- Teemu Ikonen Tue, 01 Jun 2010 17:52:08 +0200 imview (1.1.9c-6) unstable; urgency=low [ Teemu Ikonen ] * Update standards-version to 3.8.4. * Add debian/source/format file with contents '1.0'. * Rename class 'user' to 'interpreter_user'. Thanks to Adam D. Barratt for the patch (closes: #574191). [ Andreas Tille ] * Source format 3.0 (quilt) -- Andreas Tille Mon, 31 May 2010 09:29:03 +0200 imview (1.1.9c-5) unstable; urgency=low * copyright: Update current upstream source location, fix whitespace * watch: Disable (but also update the source pattern, in case upstream sources start to appear in sourceforge again) (closes: #549940) * control: - Update to standards version 3.8.3 - Update debhelper build-dep to version 7.0.50 - Add misc:Depends substvar to binary package * compat: Upgrade to debhelper level 7 * Add debhelper file imview.install * rules: Simplify using dh -- Teemu Ikonen Fri, 09 Oct 2009 18:19:18 +0200 imview (1.1.9c-4) unstable; urgency=low * configure.in: set ImageMagick CPPFLAGS with pkg-config (closes: #524591) * control: Add alternative ImageMagick build-dep, libmagickcore-dev -- Teemu Ikonen Mon, 20 Apr 2009 19:30:43 +0200 imview (1.1.9c-3) unstable; urgency=low * Merge patches/limits_h: Include limits.h where it's needed (closes: #507172) * Merge patches/magickcore: Tweak configure.in to work with imagemagick from experimental -- Teemu Ikonen Sat, 29 Nov 2008 21:28:31 +0100 imview (1.1.9c-2) unstable; urgency=low * Apply imview_huge_image_v2.patch from Daniel Anderberg fixing segfaults with large images in 64-bit platforms (closes: #493097) * control: - Change Maintainer to Debian Science Maintainers - Add Teemu Ikonen to Uploaders - Add Vcs-Browser and Vcs-Git fields pointing to git.debian.org - Upgrade standards-version to 3.8.0 * Upgrade compat and debhelper build-dep to 6 * imview.doc-base: Change doc-base section to Science/Data Analysis, fixes lintian warning 'doc-base-unknown-section'. Rewrite abstract (closes: #495385) * Refactor changes into individual TopGit branches in the git repo, these changes should not be visible in the final source package * Fix some of the whitespace issues in patches -- Teemu Ikonen Fri, 05 Sep 2008 12:11:35 +0200 imview (1.1.9c-1) unstable; urgency=low [ Teemu Ikonen ] * New upstream version (closes: #455615) * Update standards-version to 3.7.3 * Change menu section to Applications/Science/Data Analysis * Moved homepage in description to a proper dpkg field * Remove ${misc:Depends} from Depends in debian/control, due to dpkg-gencontrol warning * Work around lintian debian-rules-ignores-make-clean-error * Save upstream configure file during build to keep the Debian diff sane [ Andreas Tille ] * debian/control - Debhelper (>= 5) - Homepage tag moved to source package - Reformatted Build-Depends * debian/compat: 4 -> 5 * Added watch file -- Andreas Tille Wed, 20 Feb 2008 09:07:20 +0100 imview (1.1.8-7) unstable; urgency=low * Fix FTBS with GCC 4.3 by adding missing includes (closes: #417232) * Fix lintian warnings on badly formatted closes-statements in the Debian changelog * Update to standards version 3.7.2 * Update Debian maintainer email -- Teemu Ikonen Tue, 29 May 2007 12:44:14 +0200 imview (1.1.8-6) unstable; urgency=low * Add desktop file from Phil Bull and install (via Ubuntu and Barry deFreese) (closes: #376933) * Add namespace declarations to please gcc-4 * Fix a strange build bug where missing libXt caused X not to be found by autoconf. The only effect of this was that ImageMagick libraries were not linked in, causing e.g. reading png-files to fail. Apparently autoconf does not work properly with xorg. -- Teemu Ikonen Thu, 6 Jul 2006 15:58:00 +0200 imview (1.1.8-5) unstable; urgency=low * Add build-dependency to libxft-dev and libxinerama-dev (closes: #357368) * Update to Standards-Version: 3.6.2.2 -- Teemu Ikonen Fri, 17 Mar 2006 00:12:35 +0200 imview (1.1.8-4) unstable; urgency=low * Change configure.in to use pkg-config instead of Magick-config to drop spurious shared library dependencies (closes: #347398) * Fix lintian warning about old FSF address in debian/copyright -- Teemu Ikonen Fri, 2 Dec 2005 00:36:21 +0200 imview (1.1.8-3) unstable; urgency=low * Fix grammar in manpage (closes: #326969) * Update the Imagemagick build-dependency to libmagick9-dev | libmagick-dev (closes: #332447) * Add an icon to main window and a build-dependency to libxpm-dev * Fix debian/copyright to refer to "license", not "copyright" (closes: #337066) * Fix manpage to point to the right preference file (closes: #327884) -- Teemu Ikonen Thu, 6 Oct 2005 19:14:04 +0300 imview (1.1.8-2) unstable; urgency=low * Add AMD64 patch from Andreas Jochens (closes: #326450) * Fix null pointer reference in imageViewer when no image is loaded (closes: #326447) * Clean up debian/rules -- Teemu Ikonen Mon, 5 Sep 2005 13:13:20 +0300 imview (1.1.8-1) unstable; urgency=low * New upstream version. * Update to Standards-Version: 3.6.2.1 * Touch up the description a bit * Remove empty FAQ-file from docs * Add all the contributors found from the source code (not all them are in CREDITS) to debian/copyright * Stopped the build from changing patchlevel.h * First upload to Debian main, close the ITP on imview (Closes: #226436) -- Teemu Ikonen Thu, 18 Aug 2005 16:06:48 +0300 imview (1.1.6-2) unstable; urgency=low * Changed build-dependency from libmagick-dev to libmagick6-dev. * Commented out a call to DestroyDelegateInfo in io/readMagick.cxx, which is not in the Imagemagick API anymore. This might break things. -- Teemu Ikonen Tue, 3 Aug 2004 17:28:58 +0300 imview (1.1.6-1) unstable; urgency=low * New upstream release. -- Teemu Ikonen Tue, 3 Aug 2004 17:28:58 +0300 imview (1.1.2-1) unstable; urgency=low * Initial Release. -- Teemu Ikonen Wed, 24 Dec 2003 00:12:48 -0500 debian/copyright0000644000000000000000000001162012142241201011106 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Source: http://imview.sourceforge.net/ Upstream-Contact: Hugues Talbot Files: * Copyright: 1997-2001 Hugues Talbot License: GPL-2 On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. Files: install-sh Copyright: 1991 Massachusetts Institute of Technology License: MIT Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. M.I.T. makes no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. Files: io/byte-swap.h Copyright: 1996, 1997 John W. Eaton License: GPL-2+ On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. Files: server/socketstream.cxx server/socketstream.hxx Copyright: 2001 Maciej Sobczak, C/C++ User Journal License: Other you can use this code for any purpose without limitations (and for your own risk) as long as this notice remains Files: stl/sstream/iotraits.h stl/sstream/sstream.h stl/sstream/sstream.cc: Copyright: 1996, 1997 Dietmar Kuehl License: Other Permission to use, copy, modify, distribute and sell this > software for any purpose is hereby granted without fee, provided > that the above copyright notice appears in all copies and that > both that copyright notice and this permission notice appear in > supporting documentation. Dietmar Kuehl makes no representations > about the suitability of this software for any purpose. It is > provided "as is" without express or implied warranty. > Files: HelpView.cxx HelpView.hxx Copyright: 1997-2000 by Easy Software Products License: Other These coded instructions, statements, and computer programs are the property of Easy Software Products and are protected by Federal copyright law. Distribution and use rights are outblockd in the file "COPYING" which should have been included with this file. If this file is missing or damaged please contact Easy Software Products at: . Attn: ESP Licensing Information Easy Software Products 44141 Airport View Drive, Suite 204 Hollywood, Maryland 20636-3111 USA . Voice: (301) 373-9600 EMail: info@easysw.com WWW: http://www.easysw.com Files: StatusBox.cxx StatusBox.hxx Copyright: 1998 Craig P. Earl License: GPL-2+ On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. Files: io/readgif.cxx Copyright: 1988 by Patrick J. Naughton License: Other Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. Files: server/asynchat.cxx server/asynchat.hxx server/asyncore.cxx server/asyncore.hxx: Copyright: 1996 Sam Rushing License: Other Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of Sam Rushing not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. . SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Files: server/semaphore.cxx server/semaphore.hxx Copyright: 1995 UMASS CS Dept. License: Other This code is free software; you can redistribute it and/or modify it. However, this header must remain intact and unchanged. Additional information may be appended after this header. Publications based on this code must also include an appropriate reference. . This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. debian/README.Debian0000644000000000000000000000027212001105055011215 0ustar Imview for Debian ----------------- The manual for Imview is distributed in the Debian package imview-doc. -- Teemu Ikonen , Wed, 24 Dec 2003 00:12:48 -0500 debian/imview.doc-base0000644000000000000000000000040112001105055012045 0ustar Document: imview-help Title: Imview on-line help Author: Hugues Talbot Abstract: On-line help for Imview, an image viewer Section: Science/Data Analysis Format: HTML Index: /usr/share/doc/imview/html/quickhelp.html Files: /usr/share/doc/imview/html/*.html debian/rules0000755000000000000000000000120612142245060010241 0ustar #!/usr/bin/make -f %: dh $@ --parallel override_dh_auto_configure: dh_testdir -rm -f config.sub config.guess ln -s /usr/share/misc/config.sub config.sub ln -s /usr/share/misc/config.guess config.guess mv configure configure.original autoconf dh_auto_configure override_dh_auto_clean: dh_auto_clean -mv configure.original configure -rm -f config.status imview.list imcfg.h null.h stamp-h -rm -f Makefile fluid/Makefile io/Makefile server/Makefile -rm -f makedepend fluid/makedepend io/makedepend server/makedepend override_dh_installchangelogs: dh_installchangelogs ChangeLog override_dh_installman: dh_installman doc/imview.1 debian/imview.desktop0000644000000000000000000000037312001105055012051 0ustar [Desktop Entry] Version=1.0 Name=Imview Image Viewer GenericName=Image Viewer Comment=View and analyze scientific images Comment[en_GB]=View and analyse scientific images Type=Application Exec=imview Icon=imview Categories=Education;Science;Graphics; debian/upstream0000644000000000000000000000037712001624735010760 0ustar Reference: Author: Hugues Talbot Title: "ImView: a portable image display application" eprint: http://hugues.zahlt.info/assets/logiciel/imview-manual.pdf Homepage: http://imview.sourceforge.net/ Name: imview - image display and analysis application debian/watch0000644000000000000000000000007212001105055010203 0ustar #version=3 #http://sf.net/imview/imview-src-(.*)\.tar\.gz debian/menu0000644000000000000000000000016612001105055010045 0ustar ?package(imview):needs="X11" section="Applications/Science/Data Analysis"\ title="Imview" command="/usr/bin/imview" debian/compat0000644000000000000000000000000212142241201010351 0ustar 9 debian/imview.links0000644000000000000000000000006012001105055011511 0ustar usr/share/imview/doc /usr/share/doc/imview/html debian/docs0000644000000000000000000000007212001105055010025 0ustar README README.html TODO CONTRIBUTORS CREDITS DESCRIPTION debian/patches/0000755000000000000000000000000012142243055010613 5ustar debian/patches/07_fix_kfreebsd_FTBFS.patch0000644000000000000000000000103112105013467015515 0ustar Description: fix FTBFS on kFreeBSD* (aggregate 'semun arg' has incomplete type and cannot be defined) Author: Anton Gladky Last-Update: 2013-02-07 --- a/server/imshared.hxx +++ b/server/imshared.hxx @@ -65,7 +65,7 @@ #include // this is WEIRD! but required on Unices -#ifdef Linux +#if defined (Linux) || (__FreeBSD_kernel__) # if defined(__GNU_LIBRARY__) && !defined(_SEM_SEMUN_UNDEFINED) #warning Incorrect , workaround used. /* union semun is defined by including */ debian/patches/03_non-static.patch0000644000000000000000000000316312001624246014217 0ustar Description: Don't link fltk libraries statically Author: Michael Terry Reviewed-by: Anton Gladky Last-Update: 2012-07-18 Index: imview-1.1.9c/configure =================================================================== --- imview-1.1.9c.orig/configure 2008-02-18 12:50:49.000000000 -0500 +++ imview-1.1.9c/configure 2012-07-13 11:26:13.144871844 -0400 @@ -1739,9 +1739,9 @@ fltk_images_name=`$my_fltk_config --libs | sed 's/\(.*fltk\)\(\.a$\)/\1_images.a/'` fltk_include_flags=`$my_fltk_config --use-images --cxxflags` FLUID=${START}fluid - LDFLAGS="$LDFLAGS `$my_fltk_config --use-images --ldstaticflags`" + LDFLAGS="$LDFLAGS `$my_fltk_config --use-images --ldflags`" Cppflags="$CPPFLAGS $fltk_include_flags" - FLTKLIB="`$my_fltk_config --use-images --ldstaticflags`" + FLTKLIB="`$my_fltk_config --use-images --ldflags`" fltklib=$fltk_cfg_name fi Index: imview-1.1.9c/configure.in =================================================================== --- imview-1.1.9c.orig/configure.in 2012-07-13 11:20:07.000000000 -0400 +++ imview-1.1.9c/configure.in 2012-07-13 11:26:05.264871761 -0400 @@ -274,9 +274,9 @@ fltk_include_flags=`$my_fltk_config --use-images --cxxflags` FLUID=${START}fluid dnl Include extra library (FLTK-1.1.x) for handling various image formats. - LDFLAGS="$LDFLAGS `$my_fltk_config --use-images --ldstaticflags`" + LDFLAGS="$LDFLAGS `$my_fltk_config --use-images --ldflags`" Cppflags="$CPPFLAGS $fltk_include_flags" - FLTKLIB="`$my_fltk_config --use-images --ldstaticflags`" + FLTKLIB="`$my_fltk_config --use-images --ldflags`" fltklib=$fltk_cfg_name fi debian/patches/05_fix_dangerous_use_of_strncpy.patch0000644000000000000000000000321212105246536020123 0ustar Description: fix dangerous use of strncpy Author: Sebastian Ramacher Acked-By: Anton Gladky Bug-Debian: http://bugs.debian.org/699912 Last-Update: 2013-02-06 --- a/imview.cxx +++ b/imview.cxx @@ -1251,11 +1251,14 @@ // read the user preferences if present if (((p = getenv("IMVIEWHOME")) != 0) || ((p = getenv("HOME")) != 0)) { strncpy(prefpath, p, DFLTSTRLEN); + prefpath[DFLTSTRLEN - 1] = '\0'; + // keep these potential paths as the install path snprintf(installpath, DFLTSTRLEN, "%s%c%s", prefpath, PATHSEP, PrefPath); } else { snprintf(prefpath, DFLTSTRLEN, ".%c%s", PATHSEP, PrefPath); // look in the default installation directory (long shot) strncpy(installpath, prefpath, DFLTSTRLEN); + installpath[DFLTSTRLEN - 1] = '\0'; } #ifdef MACOSX_CARBON @@ -1274,7 +1277,8 @@ strcat(tmppath, "preferences"); dbgprintf("looking in %s\n", tmppath); if (fileprefs->readprefs(tmppath)) { - strcpy(currentprefspath, tmppath); // save the location of the prefs file + strncpy(currentprefspath, tmppath, DFLTSTRLEN); // save the location of the prefs file + currentprefspath[DFLTSTRLEN - 1] = '\0'; break; // found preferences, finished } else { // no joy there, try next string if possible if (prefpath[i] != '\0') { @@ -2056,6 +2060,7 @@ #ifdef MACOSX_CARBON char AppContainerPath[DFLTSTRLEN]; strncpy(AppContainerPath, runningpath, DFLTSTRLEN); + AppContainerPath[DFLTSTRLEN - 1] = '\0'; strncat(AppContainerPath, "/../Resources", DFLTSTRLEN); clutpathlist[4] = AppContainerPath; clutpathlist[5] = 0; debian/patches/series0000644000000000000000000000031512142242770012032 0ustar 01_fix_FTBFS_Fl_Widget.patch 02_fix_FTBFS_gcc-4.patch 03_non-static.patch 04_fix_ics_stack_smashing.patch 05_fix_dangerous_use_of_strncpy.patch 06_fix_format_not_a_string.patch 07_fix_kfreebsd_FTBFS.patch debian/patches/04_disable_ics-reader.patch0000644000000000000000000000407212142243055015643 0ustar Description: Disable ics-reader due to a buggy code. Bug-Debian: http://bugs.debian.org/699820 Author: Anton Gladky Last-Update: 2013-02-12 --- a/io/Makefile.in +++ b/io/Makefile.in @@ -55,7 +55,6 @@ readgif.cxx \ readtiff.cxx \ readZimage.cxx \ - readics.cxx \ readpnm.cxx \ cpostscript.cxx \ savetiff.cxx \ --- a/imageIO.cxx +++ b/imageIO.cxx @@ -78,7 +78,6 @@ #include "io/readgif.hxx" #include "io/readtiff.hxx" #include "io/readZimage.hxx" -#include "io/readics.hxx" #include "io/readpnm.hxx" #include "io/readsocket.hxx" #include "io/readraw.hxx" @@ -188,14 +187,6 @@ // then try our luck with SCILimage and MetaImage (mha/mhd) strcpy(tmpfilename, filename); if ((tp = strrchr(tmpfilename, '.')) != 0) { - if ((strncmp(tp, ".ics", 4) == 0) - || (strncmp(tp, ".ids", 4) == 0)) { - if (access(tmpfilename, R_OK) == 0) { - return IMAGEIO_SCILIMAGE; - } else { - return IMAGEIO_UNREADABLE; - } - } if ((strncmp(tp, ".mha", 4) == 0) || (strncmp(tp, ".mhd", 4) == 0)) { if (access(tmpfilename, R_OK) == 0) { @@ -205,14 +196,6 @@ } } } - strcat(tmpfilename, ".ics"); - if (access(tmpfilename, F_OK) == 0) { - if (access(tmpfilename, R_OK) == 0) { - return IMAGEIO_SCILIMAGE; - } else { - return IMAGEIO_UNREADABLE; - } - } @@ -328,11 +311,6 @@ rv = readZImage(filename, frame); break; - case IMAGEIO_SCILIMAGE: - dbgprintf("Input image is SCIL\n"); - rv = readICSImage(filename); - break; - case IMAGEIO_METAIMAGE: dbgprintf("Input image is META (ITK)\n"); rv = readMETAImage(filename, frame); @@ -441,10 +419,6 @@ rv = zimagenbsubfiles(fname); break; - case IMAGEIO_SCILIMAGE: - rv = icsnbsubfiles(fname); - break; - case IMAGEIO_METAIMAGE: rv = metanbsubfiles(fname); break; debian/patches/06_fix_format_not_a_string.patch0000644000000000000000000000575612105246536017070 0ustar Description: fix format not a string issue Author: Anton Gladky Last-Update: 2013-02-06 --- a/imdebug.cxx +++ b/imdebug.cxx @@ -136,7 +136,7 @@ #endif } if (outfile != 0) { - fprintf(outfile, mess); + fprintf(outfile, "%s", mess); fflush(outfile); /* slow, but WHO CARES!! */ } IM_STATUS(mess); @@ -221,7 +221,7 @@ #endif } if (outfile != 0) { - fprintf(outfile, mess); + fprintf(outfile, "%s", mess); fflush(outfile); /* slow, but WHO CARES!! */ } IM_STATUS(mess); @@ -314,7 +314,7 @@ //ret = vfprintf(stderr,strarg,args); ret = vsnprintf(mess, BUFSIZE+24, strarg, args); IM_ERROR(mess); // on the error/warning console - fprintf(stderr, mess); // on the std error stream + fprintf(stderr, "%s", mess); // on the std error stream va_end(args); semaphore_up(&access_error); @@ -333,7 +333,7 @@ ret = vsnprintf(strarg, BUFSIZE, msg,args); va_end(args); - fl_alert(strarg); // this can block for quite a long time! + fl_alert("%s", strarg); // this can block for quite a long time! semaphore_up(&access_error); return ret; --- a/menucb.cxx +++ b/menucb.cxx @@ -963,7 +963,7 @@ currentpath, runningpath ); - fl_message((const char *)buff); + fl_message("%s",(const char *)buff); return; } @@ -1305,13 +1305,13 @@ FILE *saveListFile = fopen(savePathTxt, "w"); if (saveListFile != NULL) { - fprintf(saveListFile, res); + fprintf(saveListFile, "%s", res); fclose(saveListFile); dbgprintf("Saving %d image names to %s\n", nbitems, savePathTxt); } else { sprintf(errmsg, "Error saving list to %s\n%s", savePathTxt, strerror(errno)); - fl_alert(errmsg); + fl_alert("%s", errmsg); } @@ -2051,7 +2051,7 @@ brks, PtFileMngr->getPtFileName()); - fl_message((const char *)buff); + fl_message("%s", (const char *)buff); } return; } --- a/printPrefs.cxx +++ b/printPrefs.cxx @@ -385,7 +385,7 @@ "File %s already exists\n" "Do you want to overwrite?\n", filename); - if (fl_ask(alrtmsg) == 0) { + if (fl_ask("%s", alrtmsg) == 0) { retval = 6; goto error; } --- a/printSpect.cxx +++ b/printSpect.cxx @@ -259,7 +259,7 @@ "File %s already exists\n" "Do you want to overwrite?\n", filename); - if (fl_ask(alrtmsg) == 0) { + if (fl_ask("%s", alrtmsg) == 0) { retval = 6; } } --- a/savePrefs.cxx +++ b/savePrefs.cxx @@ -269,7 +269,7 @@ "File %s already exists\n" "Do you want to overwrite?\n", filename); - if (fl_ask(alrtmsg) == 0) { + if (fl_ask("%s", alrtmsg) == 0) { // no, we don't want to overwrite... return(2); } --- a/saveSpect.cxx +++ b/saveSpect.cxx @@ -155,7 +155,7 @@ "File %s already exists\n" "Do you want to overwrite?\n", filename); - if (fl_ask(alrtmsg) == 0) { + if (fl_ask("%s", alrtmsg) == 0) { // no, we don't want to overwrite... return(2); } debian/patches/02_fix_FTBFS_gcc-4.patch0000644000000000000000000000256612001105055014624 0ustar Description: Fix FTBFS with gcc-4.7. Author: Sebastian Ramacher Reviewed-by: Anton Gladky Bug-Debian: http://bugs.debian.org/678675 Last-Update: 2012-06-24 --- a/server/socketstream.hxx +++ b/server/socketstream.hxx @@ -203,8 +203,8 @@ { if (this->gptr() == NULL) { - setg(s, s + n, s + n); - setp(s, s + n); + this->setg(s, s + n, s + n); + this->setp(s, s + n); inbuf_ = s; outbuf_ = s; bufsize_ = n; @@ -235,9 +235,9 @@ { _flush(); } - setp(outbuf_, outbuf_ + bufsize_); + this->setp(outbuf_, outbuf_ + bufsize_); if (c != traits::eof()) - sputc(traits::to_char_type(c)); + this->sputc(traits::to_char_type(c)); return 0; } @@ -245,7 +245,7 @@ { // just flush the put area _flush(); - setp(outbuf_, outbuf_ + bufsize_); + this->setp(outbuf_, outbuf_ + bufsize_); return 0; } @@ -276,7 +276,7 @@ return traits::eof(); int totalbytes = readn + remained_; - setg(inbuf_, inbuf_, + this->setg(inbuf_, inbuf_, inbuf_ + totalbytes / sizeof(char_type)); remained_ = totalbytes % sizeof(char_type); debian/patches/01_fix_FTBFS_Fl_Widget.patch0000644000000000000000000030601412001105055015565 0ustar Description: The patch fixes FTBFS Author: Teemu Ikonen Bug-Debian: http://bugs.debian.org/634418 --- a/transferRGBHistoBox.cxx +++ b/transferRGBHistoBox.cxx @@ -66,7 +66,7 @@ theRGBHisto[i][2] = 0; } - nbpix = IOBlackBox->imageWidth() * IOBlackBox->imageHeight(); + nbpix = (long)IOBlackBox->imageWidth() * (long)IOBlackBox->imageHeight(); spp = IOBlackBox->imageDepth(); if (spp == 1) { --- a/transferRGBFunction.cxx +++ b/transferRGBFunction.cxx @@ -763,7 +763,7 @@ panel->affectChannels(normR, normG, normB); panel->ensureImageRedraw(true); // we want the result to be shown on the image - nbpix = IOBlackBox->imageWidth() * IOBlackBox->imageHeight(); + nbpix = (long)IOBlackBox->imageWidth() * (long)IOBlackBox->imageHeight(); spp = IOBlackBox->imageDepth(); maxval = 0; --- a/transferHistoBox.cxx +++ b/transferHistoBox.cxx @@ -63,7 +63,7 @@ for (i = 0 ; i < 256 ; i++) theHisto[i] = 0; - nbpix = IOBlackBox->imageWidth() * IOBlackBox->imageHeight(); + nbpix = (long)IOBlackBox->imageWidth() * (long)IOBlackBox->imageHeight(); spp = IOBlackBox->imageDepth(); if (spp == 1) { --- a/transferFunction.cxx +++ b/transferFunction.cxx @@ -503,7 +503,7 @@ unsigned char *p, *end; double slope, startp; - nbpix = IOBlackBox->imageWidth() * IOBlackBox->imageHeight(); + nbpix = (long)IOBlackBox->imageWidth() * (long)IOBlackBox->imageHeight(); spp = IOBlackBox->imageDepth(); maxval = 0; --- a/printSpect.cxx +++ b/printSpect.cxx @@ -49,6 +49,7 @@ #include #include #include +#include #include #include "imview.hxx" #include "io/imSystem.hxx" @@ -539,7 +540,7 @@ return; } -void nbcopies_cb(Fl_Input *, printspect *) +void nbcopies_cb(Fl_Int_Input *, printspect *) { dbgprintf("Nb of copies callback\n"); return; --- a/printPrefs.cxx +++ b/printPrefs.cxx @@ -50,6 +50,7 @@ #include #include // needed by nocase.H #include +#include #include #include "imview.hxx" #include "nocase.hxx" @@ -588,7 +589,7 @@ return; } -void nbcopies_cb(Fl_Input *, printprefs *) +void nbcopies_cb(Fl_Int_Input *, printprefs *) { dbgprintf("Nb of copies callback\n"); return; --- a/my_Image.cxx +++ b/my_Image.cxx @@ -220,9 +220,9 @@ // realloc buffer, don't care about old content. //dbgprintf("Display: b->w=%d, b->d=%d, d=%d, x=%d, y=%d, w=%d, h=%d\n", // b->w, b->d, d, x, y, w, h); - buf = (uchar *)malloc(w * h * d * sizeof(uchar)); + buf = (uchar *)malloc((long)w * (long)h * (long)d * sizeof(uchar)); for (i = 0 ; i < h ; i++) { - memcpy(buf + i*w*d, b->data()[0] + d*x + (y+i) * b->w() * d, w * d); + memcpy(buf + (long)i*(long)w*(long)d, b->data()[0] + (long)d*(long)x + (long)(y+i) * (long)b->w() * (long)d, (long)w * (long)d); } if (d == 1) { @@ -269,8 +269,8 @@ **/ int i, j, k, ii; - int ex, inc1x, inc2x; - int ey, inc1y, inc2y; + long ex, inc1x, inc2x; + long ey, inc1y, inc2y; uchar *op; const uchar *ip; @@ -294,7 +294,7 @@ } } op = outbuf + i*ow*d; - ip = inbuf + d*x + (y+ii) * iw * d; + ip = inbuf + d*x + (y+ii) * (long)iw * d; // first pixel of the line for (k = 0 ; k < d ; k++) { *op++ = *(ip + k); @@ -354,7 +354,7 @@ **/ int i, ii; - int ey, inc1y, inc2y; + long ey, inc1y, inc2y; assert(oh > h); // we are zooming in assert(h > 0); // the bounding box does not have 0 height @@ -367,7 +367,7 @@ // first line special case: ii = 0; - memcpy(outbuf, inbuf + d * (x + y * iw), ow*d); + memcpy(outbuf, inbuf + d * (x + y * (long)iw), ow*d); if (ey > 0) { ey += inc1y; ++ii; @@ -380,7 +380,7 @@ // we have to work out a new line ey += inc1y; memcpy(outbuf + d * i*ow, - inbuf + d* (x + (y+ii) * iw), + inbuf + d* (x + (y+ii) * (long)iw), ow*d); ++ii; } else { @@ -430,8 +430,8 @@ **/ int i, j, k; - int ex, inc1x, inc2x; - int ey, inc2y; + long ex, inc1x, inc2x; + long ey, inc2y; uchar *op; const uchar *ip; @@ -442,8 +442,8 @@ for (i = 0 ; i < oh ; ++i) { - op = outbuf + i*ow*d; - ip = inbuf + d*x + (y+i) * iw * d; + op = outbuf + i*(long)ow*d; + ip = inbuf + d*x + (y+i) * (long)iw * d; // first pixel of the line for (k = 0 ; k < d ; ++k) { *op++ = *(ip + k); @@ -500,7 +500,7 @@ int i, j, k; int *accum; int nbaccum; - int ex, inc1x, inc2x; + long ex, inc1x, inc2x; uchar *op; const uchar *ip; @@ -514,7 +514,7 @@ // set up the line pointers // output will be the intermediary buffer op = outbuf + i*ow*d; // same as above - ip = inbuf + d * (x + (y+i) * iw) ; // line are not zoomed out yet. + ip = inbuf + d * (x + (y+i) * (long)iw) ; // line are not zoomed out yet. // work out what to write // -- first pixel @@ -575,7 +575,7 @@ **/ int i, j, k; - int ex, inc1x, inc2x; + long ex, inc1x, inc2x; uchar *op; const uchar *ip; @@ -587,8 +587,8 @@ inc2x = 2 * ow; // set up the line pointers // output will be the intermediary buffer - op = outbuf + i*ow*d; // same as above - ip = inbuf + d * (x + (y+i) * iw) ; // line are not zoomed out yet. + op = outbuf + i*(long)ow*(long)d; // same as above + ip = inbuf + d * (x + ((long)y+i) * (long)iw) ; // line are not zoomed out yet. // work out what to write for (j = 0 ; j < w ; j++) { if (ex > 0) { @@ -619,7 +619,7 @@ int i, j, k; int *accum; int nbaccum; - int ey, inc1y, inc2y; + long ey, inc1y, inc2y; uchar *op; const uchar *ip; @@ -633,7 +633,7 @@ // output will be the final buffer op = outbuf + j * d; // input will be the intermediary buffer allocated above - ip = inbuf + d * ((x+j) + y*iw); + ip = inbuf + d * ((x+j) + y*(long)iw); // work out what to write // first pixel for (k = 0 ; k < d ; k++) @@ -678,7 +678,7 @@ int h) /* height of BB */ { int i, j, k; - int ey, inc1y, inc2y; + long ey, inc1y, inc2y; uchar *op; const uchar *ip; @@ -691,7 +691,7 @@ // output will be the final buffer op = outbuf + j * d; // input will be the intermediary buffer allocated above - ip = inbuf + d * ((x+j) + y*iw); + ip = inbuf + d * ((x+j) + y*(long)iw); // work out what to write // rest of the column for (i = 0 ; i < h ; i++) { @@ -824,7 +824,7 @@ free(buf2); buf2 = 0; } - buf2 = (uchar *)malloc(ow * h * d * sizeof(uchar)); + buf2 = (uchar *)malloc(ow * (long)h * d * sizeof(uchar)); // zoom out the x dimension if (drawsmooth) zoomoutw_smooth(buf2,(const uchar*)(b->data()[0]),ow,d,b->w(),x,y,w,h); --- a/menucb.cxx +++ b/menucb.cxx @@ -1079,24 +1079,34 @@ } } -// lauches netscape to read the full documentation +// lauches a browser to read the full documentation void fulldocument_cb(Fl_Object *, void *) { static char command[1024]; + char helpurl[1024]; + FILE *helpfile; + if((helpfile = fopen(LOCALHELP, "r")) != NULL) { + fclose(helpfile); + strncpy(helpurl, "file://", 1024); + strncat(helpurl, LOCALHELP, 1016); + } else { + strncpy(helpurl, HELPURL, 1024); + } + sprintf(command, - "netscape -remote openURL\\(%s,new-window\\)", HELPURL); + "sensible-browser %s &", helpurl); int ret = system((const char *)command); if (ret != 0) { - // try calling netscape directly! + // try calling firefox directly! sprintf(command, - "netscape %s &", HELPURL); + "firefox %s &", helpurl); ret = system((const char *)command); if (ret != 0) - errprintf("Sorry, can't start netscape\n" + errprintf("Sorry, can't start browser\n" "Help URL is:\n" "%s", - HELPURL); + helpurl); } } --- a/menubar.hxx +++ b/menubar.hxx @@ -61,7 +61,8 @@ #define ONLINEHELP "quickhelp.html" #define LICENSE "gpl.html" #define WARRANTY "warranty.html" -#define HELPURL "http://extra.cmis.csiro.au/IA/talbot/ee02only/imview/" +#define HELPURL "http://www.cmis.csiro.au/Hugues.Talbot/imview/online/imview.html" +#define LOCALHELP "/usr/share/doc/imview-doc/html/imview.html" #define IMAGE_LIST_BEGIN "Image list" #define CLUT_LIST_BEGIN "Default Colourmap" --- /dev/null +++ b/imview.xpm @@ -0,0 +1,294 @@ +/* XPM */ +static char *imview_icon_xpm[] = { +/* columns rows colors chars-per-pixel */ +"32 32 256 2", +" c #010101", +". c #080504", +"X c #0A0B04", +"o c #0C0B0A", +"O c #050506", +"+ c #01021C", +"@ c #100D0B", +"# c #12140D", +"$ c #14190C", +"% c #18110A", +"& c #131313", +"* c #1A1C11", +"= c #1B1919", +"- c #181318", +"; c #110F15", +": c #181C22", +"> c #04042B", +", c #1A2212", +"< c #192514", +"1 c #1B2913", +"2 c #1A242B", +"3 c #201B0D", +"4 c #201E11", +"5 c #201818", +"6 c #36151B", +"7 c #2E1110", +"8 c #251B20", +"9 c #232112", +"0 c #242A14", +"q c #2B2B13", +"w c #292617", +"e c #2B3616", +"r c #2D3919", +"t c #263716", +"y c #312C14", +"u c #323D1A", +"i c #373816", +"p c #28280B", +"a c #2A2628", +"s c #333333", +"d c #393737", +"f c #342C2A", +"g c #1C1B7B", +"h c #0B0C6F", +"j c #39374A", +"k c #3D3762", +"l c #252070", +"z c #14145B", +"x c #2E4618", +"c c #33421B", +"v c #38481A", +"b c #3B5718", +"n c #354D20", +"m c #3A5921", +"M c #387C15", +"N c #4A1529", +"B c #433417", +"V c #5D3217", +"C c #443522", +"Z c #493728", +"A c #4D3035", +"S c #6D2216", +"D c #62383E", +"F c #6D2C36", +"G c #583754", +"H c #573C44", +"J c #623745", +"K c #6A3468", +"L c #464A1A", +"P c #47551A", +"I c #564C1A", +"U c #57571B", +"Y c #54480F", +"T c #465721", +"R c #54452E", +"E c #594A3C", +"W c #4B5022", +"Q c #477416", +"! c #566515", +"~ c #4F7018", +"^ c #466525", +"/ c #566723", +"( c #567427", +") c #4B7228", +"_ c #615018", +"` c #6A563A", +"' c #775936", +"] c #735233", +"[ c #677C2B", +"{ c #434344", +"} c #4B4B4B", +"| c #574648", +" . c #5C4C59", +".. c #5A5A5A", +"X. c #555252", +"o. c #554A51", +"O. c #5C6077", +"+. c #624546", +"@. c #645D5C", +"#. c #76594F", +"$. c #775459", +"%. c #764552", +"&. c #6E566A", +"*. c #786952", +"=. c #6C6C6C", +"-. c #646464", +";. c #756764", +":. c #737373", +">. c #79797A", +",. c #706C76", +"<. c #52507E", +"1. c #0C119C", +"2. c #05088B", +"3. c #0C12B5", +"4. c #1517A8", +"5. c #1419B6", +"6. c #080CA2", +"7. c #1E228F", +"8. c #1B20B6", +"9. c #2F2B90", +"0. c #2525A9", +"q. c #2527B8", +"w. c #0F17C2", +"e. c #1A20C4", +"r. c #272AC3", +"t. c #44319C", +"y. c #483C8D", +"u. c #463CA2", +"i. c #4037B6", +"p. c #5C5184", +"a. c #554693", +"s. c #544EB3", +"d. c #725D88", +"f. c #69538E", +"g. c #645BB3", +"h. c #796A98", +"j. c #6C6592", +"k. c #6269B7", +"l. c #6F6AA2", +"z. c #5E862E", +"x. c #648717", +"c. c #678F32", +"v. c #788572", +"b. c #7E8483", +"n. c #801E31", +"m. c #953226", +"M. c #853010", +"N. c #8C3A54", +"B. c #B93558", +"V. c #82572E", +"C. c #8C683B", +"Z. c #AF4420", +"A. c #8B5758", +"S. c #895E42", +"D. c #865265", +"F. c #8C7455", +"G. c #947549", +"H. c #977A56", +"J. c #846D48", +"K. c #8A6366", +"L. c #8B7668", +"P. c #936667", +"I. c #947578", +"U. c #93756F", +"Y. c #A74C5D", +"T. c #A74874", +"R. c #AB4F6B", +"E. c #A77B49", +"W. c #AD7E4A", +"Q. c #B96C78", +"!. c #A96F6C", +"~. c #CC4D1D", +"^. c #C0546F", +"/. c #C3787E", +"(. c #CC4D5D", +"). c #945C84", +"_. c #8B7696", +"`. c #8A78AE", +"'. c #A87F8A", +"]. c #8D79D0", +"[. c #CB7E8F", +"{. c #9D8262", +"}. c #82817B", +"|. c #AB8358", +" X c #B8834C", +".X c #B88755", +"XX c #A88768", +"oX c #A48775", +"OX c #BC926C", +"+X c #BA9474", +"@X c #B38E6B", +"#X c #BDB476", +"$X c #C78E56", +"%X c #CA9057", +"&X c #C08446", +"*X c #C89467", +"=X c #C59876", +"-X c #D49F72", +";X c #828482", +":X c #898A89", +">X c #988987", +",X c #988D9B", +"XBXI.; : 5 6 6 mXI.T.^.B.}.eXI.6XVXsX", +"..O =.F.rX@XwXXXE } :.& o 6X!.; 8 N N.MXPXuXXrXX..yXuX5X:X=.=.b.", +"+X@X%X%X=XbX=X8X8X|.#.R 5XBXNXxXGX,X_.,.>XxXaXLXAX3X'.| SXiXSXyX", +"OX.X.XOXzXzXOXI.| w O O ;.8XU.d O O A d J 9XPXAXs o a BXwXuXpX", +"|. XE.=XMX` O d :.s O O = =.-.. 7 MXJXMXo = :... X.>XQ.:X", +"|.C.XXMXbX. { pXUXIXIX{ { AXIXIXIX1X I.mXpX aXIXIXX.+.xX%.uX", +"|. XMXNX*X@ s 1XPXIXIX; f =.;XPXIXPX =.AXyX :XIXIX>.| LX{ o.", +"$XOX-X*X%XV.% tXIXDX Z = ; >.IXIX= A sXsX& =.IXIX} | PXD.$.", +"%X*X%X X*X&X' DXIXtX =XKXKXZ d IXIXs 8 1XxX5 d IXPXO X.wXY.D.", +"B C B C Z B 3 @ IXIX:. R E } 5 & IXIX} 5 DX9X. ..IX>. .pXnXnX", +"# # # & # & O d IXIX{ O $ $ $ o IXIX-.. ,XH AXPX; 2 qXdXqXa.", +"# & # < t < O =.IXIX# @ y y y # HXIX>. <. X.IX..O h 4.6.6.6.", +"< < < < < & 1XIXDX $ 0 0 0 , . jXIX. t 0 0 t 0 :XIXVX s IX} 7.0.5.q.8.5.3.", +"n x t * , X f IXIX{ X c v v v e :.IXDXo DX;X j h.s.q.r.e.w.w.", +"1 0 n u 0 O ..IXIX& p v t 0 U Y . ..IXUXtXpXO > g.p.h.l.g h 1.3.", +"= , T / t >.IXIX& O q x.X { IXIXDX& + 2.e.s.p.k d.a.h f.", +"q n ( x r =.IXIXHXtXpXUX p ~ X } IXUXs $ k l q.q.g p.d.#.S Z.", +"e e Q t u $ & AXIXPXpX=.= L ! >.IX{ *.*.#XZXh.k <.] S C.pX", +"r m M c b e O 7 B P U ;.oX#. #include #include +#include +#include #ifdef WIN32_NOTCYGWIN # include @@ -117,6 +119,7 @@ #include "sliceSlider.hxx" // generic panel with linked slider/value #include "view3d.hxx" // 3D image viewer #include "patchlevel.h" +#include "imview.xpm" typedef map::const_iterator cmi; // const Map iterator @@ -2090,6 +2093,11 @@ // do not show it though } + // add an icon to main window + Pixmap icon_pixmap, icon_mask; + XpmCreatePixmapFromData(fl_display, DefaultRootWindow(fl_display), + imview_icon_xpm, &icon_pixmap, &icon_mask, NULL); + mainWindow->icon((char *)icon_pixmap); if (performFork) srv_dbgprintf("About to put main window on screen\n"); // show the main window mainWindow->show(argc, argv); --- a/imtranslate.cxx +++ b/imtranslate.cxx @@ -528,10 +528,10 @@ returnInfo[i] = (double) *((uchar *)currBuffp[i] + zoff + currImgWidth*ypos + xpos); } else { if (currImgNbSamples == 1) - returnInfo[0] = (double) *(imdata + currImgWidth*ypos + xpos); + returnInfo[0] = (double) *(imdata + (long)currImgWidth*(long)ypos + xpos); else if (currImgNbSamples == 3) { uchar *xp; - xp = imdata + 3 * (currImgWidth*ypos + xpos); + xp = imdata + 3 * ((long)currImgWidth*(long)ypos + xpos); returnInfo[0] = (double) *xp; returnInfo[1] = (double) *(xp+1); returnInfo[2] = (double) *(xp+2); @@ -543,14 +543,14 @@ case IM_INT2: if (currBuffp != 0) { for (int i = 0 ; i < currImgNbSamples ; i++) - returnInfo[i] = (double) *((short *)currBuffp[i] + zoff + currImgWidth*ypos + xpos); + returnInfo[i] = (double) *((short *)currBuffp[i] + zoff + (long)currImgWidth*(long)ypos + xpos); } break; case IM_UINT2: if (currBuffp != 0) { for (int i = 0 ; i < currImgNbSamples ; i++) - returnInfo[i] = (double) *((unsigned short *)currBuffp[i] + zoff + currImgWidth*ypos + xpos); + returnInfo[i] = (double) *((unsigned short *)currBuffp[i] + zoff + (long)currImgWidth*(long)ypos + xpos); } break; @@ -558,21 +558,21 @@ case IM_UINT4: if (currBuffp != 0) { for (int i = 0 ; i < currImgNbSamples ; i++) - returnInfo[i] = (double) *((int *)currBuffp[i] + zoff + currImgWidth*ypos + xpos); + returnInfo[i] = (double) *((int *)currBuffp[i] + zoff + (long)currImgWidth*(long)ypos + xpos); } break; case IM_FLOAT: if (currBuffp != 0) { for (int i = 0 ; i < currImgNbSamples ; i++) - returnInfo[i] = (double) *((float *)currBuffp[i] + zoff + currImgWidth*ypos + xpos); + returnInfo[i] = (double) *((float *)currBuffp[i] + zoff + (long)currImgWidth*(long)ypos + xpos); } break; case IM_DOUBLE: if (currBuffp != 0) { for (int i = 0 ; i < currImgNbSamples ; i++) - returnInfo[i] = *((double *)currBuffp[i] + zoff + currImgWidth*ypos + xpos); + returnInfo[i] = *((double *)currBuffp[i] + zoff + (long)currImgWidth*(long)ypos + xpos); } break; @@ -722,16 +722,16 @@ case IM_INT1: if ((currBuffp != 0) && (currBuffp[cpos] != 0)) { for (int i = 0 ; i < currImgThickness; i++) - returnInfo[i] = (double) *((uchar *)currBuffp[cpos] + zoff*i + currImgWidth*ypos + xpos); + returnInfo[i] = (double) *((uchar *)currBuffp[cpos] + zoff*i + (long)currImgWidth*(long)ypos + xpos); } else { if (currImgNbSamples == 1) for (int i = 0 ; i < currImgThickness; i++) - returnInfo[i] = (double) *(imdata + zoff*i + currImgWidth*ypos + xpos); + returnInfo[i] = (double) *(imdata + zoff*i + (long)currImgWidth*(long)ypos + xpos); else if (currImgNbSamples == 3) { uchar *xp; - xp = imdata + 3 * (currImgWidth*ypos + xpos); + xp = imdata + 3 * ((long)currImgWidth*(long)ypos + xpos); for (int i = 0 ; i < currImgThickness; i++) - returnInfo[i] = (double) *(imdata + 3 * (zoff*i + currImgWidth*ypos + xpos) + cpos); + returnInfo[i] = (double) *(imdata + 3 * (zoff*i + (long)currImgWidth*(long)ypos + xpos) + cpos); } } break; @@ -740,14 +740,14 @@ case IM_INT2: if ((currBuffp != 0) && (currBuffp[cpos] != 0)) { for (int i = 0 ; i < currImgThickness ; i++) - returnInfo[i] = (double) *((short *)currBuffp[cpos] + zoff*i + currImgWidth*ypos + xpos); + returnInfo[i] = (double) *((short *)currBuffp[cpos] + zoff*i + (long)currImgWidth*(long)ypos + xpos); } break; case IM_UINT2: if ((currBuffp != 0) && (currBuffp[cpos] != 0)) { for (int i = 0 ; i < currImgThickness ; i++) - returnInfo[i] = (double) *((unsigned short *)currBuffp[cpos] + zoff*i + currImgWidth*ypos + xpos); + returnInfo[i] = (double) *((unsigned short *)currBuffp[cpos] + zoff*i + (long)currImgWidth*(long)ypos + xpos); } break; @@ -755,21 +755,21 @@ case IM_UINT4: if ((currBuffp != 0) && (currBuffp[cpos] != 0)) { for (int i = 0 ; i < currImgThickness ; i++) - returnInfo[i] = (double) *((int *)currBuffp[cpos] + zoff*i + currImgWidth*ypos + xpos); + returnInfo[i] = (double) *((int *)currBuffp[cpos] + zoff*i + (long)currImgWidth*(long)ypos + xpos); } break; case IM_FLOAT: if ((currBuffp != 0) && (currBuffp[cpos] != 0)) { for (int i = 0 ; i < currImgThickness ; i++) - returnInfo[i] = (double) *((float *)currBuffp[cpos] + zoff*i + currImgWidth*ypos + xpos); + returnInfo[i] = (double) *((float *)currBuffp[cpos] + zoff*i + (long)currImgWidth*(long)ypos + xpos); } break; case IM_DOUBLE: if ((currBuffp != 0) && (currBuffp[cpos] != 0)) { for (int i = 0 ; i < currImgThickness ; i++) - returnInfo[i] = *((double *)currBuffp[cpos] + zoff*i + currImgWidth*ypos + xpos); + returnInfo[i] = *((double *)currBuffp[cpos] + zoff*i + (long)currImgWidth*(long)ypos + xpos); } break; @@ -999,7 +999,7 @@ typeName(currPixType)); freeCurrentBuffers(); // fake buffer to get through this tough point - newbuf = new uchar[currImgWidth*currImgHeight]; + newbuf = new uchar[(long)currImgWidth*(long)currImgHeight]; newspp = 1; break; } @@ -1083,13 +1083,13 @@ if ((currBuffp = (void **)malloc(sizeof(void *))) == 0) { errprintf("ApplyCLUTtoCurrentImage: not enough memory!\n"); retval = 2; - } else if ((currBuffp[0] = (uchar *)malloc(currImgWidth*currImgHeight*sizeof(uchar))) == 0) { + } else if ((currBuffp[0] = (uchar *)malloc((long)currImgWidth*(long)currImgHeight*sizeof(uchar))) == 0) { free(currBuffp); currBuffp = 0; errprintf("ApplyCLUTtoCurrentImage: not enough memory!\n"); retval = 3; } else { - memcpy(currBuffp[0], imdata, currImgWidth*currImgHeight*sizeof(uchar)); + memcpy(currBuffp[0], imdata, (long)currImgWidth*(long)currImgHeight*sizeof(uchar)); } } } @@ -1313,13 +1313,13 @@ if ((currBuffp = (void **)malloc(sizeof(void *))) == 0) { errprintf("saveToRawBuffers: not enough memory!\n"); retval = 2; - } else if ((currBuffp[0] = (uchar *)malloc(currImgWidth*currImgHeight*sizeof(uchar))) == 0) { + } else if ((currBuffp[0] = (uchar *)malloc((long)currImgWidth*(long)currImgHeight*sizeof(uchar))) == 0) { free(currBuffp); currBuffp = 0; errprintf("saveToRawBuffers: not enough memory!\n"); retval = 3; } else { - memcpy(currBuffp[0], imdata, currImgWidth*currImgHeight*sizeof(uchar)); + memcpy(currBuffp[0], imdata, (long)currImgWidth*(long)currImgHeight*sizeof(uchar)); dontFreeBuffers = false; // we _can_ free these buffers! } } @@ -1337,18 +1337,18 @@ if ((currBuffp = (void **)malloc(3*sizeof(void *))) == 0) { errprintf("saveToRawBuffers: not enough memory!\n"); retval = 2; - } else if ((currBuffp[0] = (uchar *)malloc(currImgWidth*currImgHeight*sizeof(uchar))) == 0) { + } else if ((currBuffp[0] = (uchar *)malloc((long)currImgWidth*(long)currImgHeight*sizeof(uchar))) == 0) { free(currBuffp); currBuffp = 0; errprintf("saveToRawBuffers: not enough memory for first component!\n"); retval = 3; - } else if ((currBuffp[1] = (uchar *)malloc(currImgWidth*currImgHeight*sizeof(uchar))) == 0) { + } else if ((currBuffp[1] = (uchar *)malloc((long)currImgWidth*(long)currImgHeight*sizeof(uchar))) == 0) { free(currBuffp[0]); free(currBuffp); currBuffp = 0; errprintf("saveToRawBuffers: not enough memory for second component!\n"); retval = 3; - } else if ((currBuffp[2] = (uchar *)malloc(currImgWidth*currImgHeight*sizeof(uchar))) == 0) { + } else if ((currBuffp[2] = (uchar *)malloc((long)currImgWidth*(long)currImgHeight*sizeof(uchar))) == 0) { free(currBuffp[1]); free(currBuffp[0]); free(currBuffp); @@ -1356,9 +1356,9 @@ errprintf("saveToRawBuffers: not enough memory for third component!\n"); retval = 3; } else { - memcpy(currBuffp[0], imdata, currImgWidth*currImgHeight*sizeof(uchar)); - memcpy(currBuffp[1], imdata, currImgWidth*currImgHeight*sizeof(uchar)); - memcpy(currBuffp[2], imdata, currImgWidth*currImgHeight*sizeof(uchar)); + memcpy(currBuffp[0], imdata, (long)currImgWidth*(long)currImgHeight*sizeof(uchar)); + memcpy(currBuffp[1], imdata, (long)currImgWidth*(long)currImgHeight*sizeof(uchar)); + memcpy(currBuffp[2], imdata, (long)currImgWidth*(long)currImgHeight*sizeof(uchar)); imspp = 3; currImgNbSamples = 3; dontFreeBuffers = false; // these buffers _can_ be freed @@ -1378,18 +1378,18 @@ if ((currBuffp = (void **)malloc(3*sizeof(void *))) == 0) { errprintf("saveToRawBuffers: not enough memory!\n"); retval = 2; - } else if ((currBuffp[0] = (uchar *)malloc(currImgWidth*currImgHeight*sizeof(uchar))) == 0) { + } else if ((currBuffp[0] = (uchar *)malloc((long)currImgWidth*(long)currImgHeight*sizeof(uchar))) == 0) { free(currBuffp); currBuffp = 0; errprintf("saveToRawBuffers: not enough memory for first component!\n"); retval = 3; - } else if ((currBuffp[1] = (uchar *)malloc(currImgWidth*currImgHeight*sizeof(uchar))) == 0) { + } else if ((currBuffp[1] = (uchar *)malloc((long)currImgWidth*(long)currImgHeight*sizeof(uchar))) == 0) { free(currBuffp[0]); free(currBuffp); currBuffp = 0; errprintf("saveToRawBuffers: not enough memory for second component!\n"); retval = 3; - } else if ((currBuffp[2] = (uchar *)malloc(currImgWidth*currImgHeight*sizeof(uchar))) == 0) { + } else if ((currBuffp[2] = (uchar *)malloc((long)currImgWidth*(long)currImgHeight*sizeof(uchar))) == 0) { free(currBuffp[1]); free(currBuffp[0]); free(currBuffp); @@ -1631,10 +1631,10 @@ newDepth = 3; // allocate new memory dbgprintf("Allocating a new buffer\n"); - *outbuf = new uchar[3*currImgWidth*currImgHeight]; + *outbuf = new uchar[3*(long)currImgWidth*(long)currImgHeight]; p = *outbuf; - end = *outbuf + 3*currImgWidth * currImgHeight; + end = *outbuf + 3*(long)currImgWidth * (long)currImgHeight; qR = (uchar *)(currBuffp[0]) + buffZOffset; qG = (uchar *)(currBuffp[1]) + buffZOffset; qB = (uchar *)(currBuffp[2]) + buffZOffset; @@ -1658,9 +1658,9 @@ dbgprintf("Image with %d samples, processing sample %d\n", currImgNbSamples, currComp); newDepth = 1; dbgprintf("Allocating a new buffer\n"); - *outbuf = new uchar[currImgWidth*currImgHeight]; + *outbuf = new uchar[(long)currImgWidth*(long)currImgHeight]; p = *outbuf; - end = *outbuf + currImgWidth * currImgHeight; + end = *outbuf + (long)currImgWidth * (long)currImgHeight; q = (uchar *)(currBuffp[currComp]) + buffZOffset; // only the first map is relevant assert(Rmap != 0); @@ -1698,7 +1698,7 @@ dbgprintf("Image with 3 samples, treating as RGB\n"); newDepth = 3; dbgprintf("Allocating a new buffer\n"); - *outbuf = new uchar[3*currImgWidth*currImgHeight]; + *outbuf = new uchar[3*(long)currImgWidth*(long)currImgHeight]; // find global min and max now. minval = *((T *)(currBuffp[0]) + buffZOffset); @@ -1706,7 +1706,7 @@ for (i = 0 ; i < 3 ; i++) { q = (T *)(currBuffp[i]) + buffZOffset; - iend = q + currImgWidth * currImgHeight; + iend = q + (long)currImgWidth * (long)currImgHeight; while (q < iend) { if (*q < minval) minval = *q; @@ -1728,7 +1728,7 @@ w1 = highthresh - lowthresh; q = (T *)(currBuffp[i]) + buffZOffset; - iend = q + currImgWidth * currImgHeight; + iend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf + i; while (q < iend) { if (*q <= lowthresh) { @@ -1750,7 +1750,7 @@ w1 = highthresh - lowthresh; q = (T *)(currBuffp[i]) + buffZOffset; - iend = q + currImgWidth * currImgHeight; + iend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf + i; while (q < iend) { if (*q <= lowthresh) { @@ -1771,14 +1771,14 @@ dbgprintf("Image with %d samples, processing sample %d\n", currImgNbSamples, currComp); newDepth = 1; dbgprintf("Allocating a new buffer\n"); - *outbuf = new uchar[currImgWidth*currImgHeight]; + *outbuf = new uchar[(long)currImgWidth*(long)currImgHeight]; // find global min and max now. minval = *((T *)(currBuffp[currComp]) + buffZOffset); maxval = minval; q = (T *)(currBuffp[currComp]) + buffZOffset; - iend = q + currImgWidth * currImgHeight; + iend = q + (long)currImgWidth * (long)currImgHeight; // only the red-channel transform is relevant while (q < iend) { @@ -1801,7 +1801,7 @@ w1 = highthresh - lowthresh; q = (T *)(currBuffp[currComp]) + buffZOffset; - iend = q + currImgWidth * currImgHeight; + iend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf; while (q < iend) { if (*q <= lowthresh) { @@ -1823,7 +1823,7 @@ w1 = highthresh - lowthresh; q = (T *)(currBuffp[currComp]) + buffZOffset; - iend = q + currImgWidth * currImgHeight; + iend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf; while (q < iend) { if (*q <= lowthresh) { @@ -1867,14 +1867,14 @@ dbgprintf("Image with 3 samples, treating as RGB\n"); newDepth = 3; dbgprintf("Allocating a new buffer\n"); - *outbuf = new uchar[3*currImgWidth*currImgHeight]; + *outbuf = new uchar[3*(long)currImgWidth*(long)currImgHeight]; // find global min and max now. minval = USHRT_MAX; maxval = 0; // yes we know that for (i = 0 ; i < 3 ; i++) { q = (ushort *)(currBuffp[i]) + buffZOffset; - dend = q + currImgWidth * currImgHeight; + dend = q + (long)currImgWidth * (long)currImgHeight; while (q < dend) { if (*q < minval) minval = *q; @@ -1896,7 +1896,7 @@ w1 = highthresh - lowthresh; q = (ushort *)(currBuffp[i]) + buffZOffset; - dend = q + currImgWidth * currImgHeight; + dend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf + i; while (q < dend) { if (*q <= lowthresh) { @@ -1918,7 +1918,7 @@ w1 = highthresh - lowthresh; q = (ushort *)(currBuffp[i]) + buffZOffset; - dend = q + currImgWidth * currImgHeight; + dend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf + i; while (q < dend) { if (*q <= lowthresh) { @@ -1939,14 +1939,14 @@ dbgprintf("Image with %d samples, processing sample %d\n", currImgNbSamples, currComp); newDepth = 1; dbgprintf("Allocating a new buffer\n"); - *outbuf = new uchar[currImgWidth*currImgHeight]; + *outbuf = new uchar[(long)currImgWidth*(long)currImgHeight]; // find global min and max now. minval = USHRT_MAX; maxval = 0; q = (ushort *)(currBuffp[currComp]) + buffZOffset; - dend = q + currImgWidth * currImgHeight; + dend = q + (long)currImgWidth * (long)currImgHeight; // only the red-channel transform is relevant while (q < dend) { @@ -1968,7 +1968,7 @@ w1 = highthresh - lowthresh; q = (ushort *)(currBuffp[currComp]) + buffZOffset; - dend = q + currImgWidth * currImgHeight; + dend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf; while (q < dend) { if (*q <= lowthresh) { @@ -1990,7 +1990,7 @@ w1 = highthresh - lowthresh; q = (ushort *)(currBuffp[currComp]) + buffZOffset; - dend = q + currImgWidth * currImgHeight; + dend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf; while (q < dend) { if (*q <= lowthresh) { @@ -2031,14 +2031,14 @@ dbgprintf("Image with 3 samples, treating as RGB\n"); newDepth = 3; dbgprintf("Allocating a new buffer\n"); - *outbuf = new uchar[3*currImgWidth*currImgHeight]; + *outbuf = new uchar[3*(long)currImgWidth*(long)currImgHeight]; // find global min and max now. minval = INT_MAX; maxval = INT_MIN; for (i = 0 ; i < 3 ; i++) { q = (int *)(currBuffp[i]) + buffZOffset; - iend = q + currImgWidth * currImgHeight; + iend = q + (long)currImgWidth * (long)currImgHeight; while (q < iend) { if (*q < minval) minval = *q; @@ -2060,7 +2060,7 @@ w1 = highthresh - lowthresh; q = (int *)(currBuffp[i]) + buffZOffset; - iend = q + currImgWidth * currImgHeight; + iend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf + i; while (q < iend) { if (*q <= lowthresh) { @@ -2082,7 +2082,7 @@ w1 = highthresh - lowthresh; q = (int *)(currBuffp[i]) + buffZOffset; - iend = q + currImgWidth * currImgHeight; + iend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf + i; while (q < iend) { if (*q <= lowthresh) { @@ -2110,7 +2110,7 @@ maxval = INT_MIN; q = (int *)(currBuffp[currComp]) + buffZOffset; - iend = q + currImgWidth * currImgHeight; + iend = q + (long)currImgWidth * (long)currImgHeight; // only the red-channel transform is relevant while (q < iend) { @@ -2132,7 +2132,7 @@ w1 = highthresh - lowthresh; q = (int *)(currBuffp[currComp]) + buffZOffset; - iend = q + currImgWidth * currImgHeight; + iend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf; while (q < iend) { if (*q <= lowthresh) { @@ -2154,7 +2154,7 @@ w1 = highthresh - lowthresh; q = (int *)(currBuffp[currComp]) + buffZOffset; - iend = q + currImgWidth * currImgHeight; + iend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf; while (q < iend) { if (*q <= lowthresh) { @@ -2198,14 +2198,14 @@ dbgprintf("Image with 3 samples, treating as RGB\n"); newDepth = 3; dbgprintf("Allocating a new buffer\n"); - *outbuf = new uchar[3*currImgWidth*currImgHeight]; + *outbuf = new uchar[3*(long)currImgWidth*(long)currImgHeight]; // find global min and max now. minval = DBL_MAX; maxval = DBL_MIN; for (i = 0 ; i < 3 ; i++) { q = (double *)(currBuffp[i]) + buffZOffset; - dend = q + currImgWidth * currImgHeight; + dend = q + (long)currImgWidth * (long)currImgHeight; while (q < dend) { if (*q < minval) minval = *q; @@ -2227,7 +2227,7 @@ w1 = highthresh - lowthresh; q = (double *)(currBuffp[i]) + buffZOffset; - dend = q + currImgWidth * currImgHeight; + dend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf + i; while (q < dend) { if (*q <= lowthresh) { @@ -2249,7 +2249,7 @@ w1 = highthresh - lowthresh; q = (double *)(currBuffp[i]) + buffZOffset; - dend = q + currImgWidth * currImgHeight; + dend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf + i; while (q < dend) { if (*q <= lowthresh) { @@ -2270,14 +2270,14 @@ dbgprintf("Image with %d samples, processing sample %d\n", currImgNbSamples, currComp); newDepth = 1; dbgprintf("Allocating a new buffer\n"); - *outbuf = new uchar[currImgWidth*currImgHeight]; + *outbuf = new uchar[(long)currImgWidth*(long)currImgHeight]; // find global min and max now. minval = DBL_MAX; maxval = DBL_MIN; q = (double *)(currBuffp[currComp]) + buffZOffset; - dend = q + currImgWidth * currImgHeight; + dend = q + (long)currImgWidth * (long)currImgHeight; // only the red-channel transform is relevant while (q < dend) { @@ -2299,7 +2299,7 @@ w1 = highthresh - lowthresh; q = (double *)(currBuffp[currComp]) + buffZOffset; - dend = q + currImgWidth * currImgHeight; + dend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf; while (q < dend) { if (*q <= lowthresh) { @@ -2321,7 +2321,7 @@ w1 = highthresh - lowthresh; q = (double *)(currBuffp[currComp]) + buffZOffset; - dend = q + currImgWidth * currImgHeight; + dend = q + (long)currImgWidth * (long)currImgHeight; p = *outbuf; while (q < dend) { if (*q <= lowthresh) { @@ -2361,13 +2361,13 @@ int retval = 0; if (!overlay) { - overlay = new uchar[currImgWidth * currImgHeight]; + overlay = new uchar[(long)currImgWidth * (long)currImgHeight]; ovlspp = 1; - memset(overlay, 0, currImgWidth * currImgHeight * sizeof(uchar)); + memset(overlay, 0, (long)currImgWidth * (long)currImgHeight * sizeof(uchar)); } // array bounds check - if (index < currImgWidth*currImgHeight) + if (index < (long)currImgWidth*(long)currImgHeight) overlay[index] = value; return retval; @@ -2396,11 +2396,11 @@ if (ovlspp == 1) { if (imspp != 3) { // we'll have to make it colour - newbuf = new uchar[3*currImgWidth*currImgHeight]; + newbuf = new uchar[3*(long)currImgWidth*(long)currImgHeight]; p = imdata; q = newbuf; - r = overlay + currZpos * currImgWidth * currImgHeight; - end = q + 3*currImgWidth * currImgHeight; + r = overlay + currZpos * (long)currImgWidth * (long)currImgHeight; + end = q + 3*(long)currImgWidth * (long)currImgHeight; /* this will ensure we can safely apply the colour overlay */ assert(MAX_FL_COLOURS > 255); @@ -2429,7 +2429,7 @@ } else { q = imdata; r = overlay + currZpos * currImgWidth * currImgHeight; - end = q + 3*currImgWidth * currImgHeight; + end = q + 3*(long)currImgWidth * (long)currImgHeight; if (ovl_transparency == 0.0) { while (q != end) { @@ -2453,15 +2453,15 @@ } else { // ovlspp == 3 if (imspp != 3) { // we'll have to make it colour - newbuf = new uchar[3*currImgWidth*currImgHeight]; + newbuf = new uchar[3*(long)currImgWidth*(long)currImgHeight]; p = imdata; q = newbuf; r = overlay; - end = q + 3*currImgWidth * currImgHeight; + end = q + 3*(long)currImgWidth * (long)currImgHeight; if (ovl_transparency == 0.0) { // very simple and very fast - memcpy(newbuf, overlay, 3 * currImgWidth * currImgHeight); + memcpy(newbuf, overlay, 3 * (long)currImgWidth * (long)currImgHeight); } else { // more expensive calculation while (q != end) { @@ -2481,11 +2481,11 @@ // just overwrite imdata q = imdata; r = overlay; - end = q + 3*currImgWidth * currImgHeight; + end = q + 3*(long)currImgWidth * (long)currImgHeight; if (ovl_transparency == 0.0) { // simple - memcpy(imdata, overlay, 3 * currImgWidth * currImgHeight); + memcpy(imdata, overlay, 3 * (long)currImgWidth * (long)currImgHeight); } else { while (q != end) { *q = (uchar)(*r + (*q - *r) * ovl_transparency); @@ -2640,7 +2640,7 @@ if (p->zslice >= currImgThickness) p->zslice = currImgThickness - 1; currZpos = p->zslice; - buffZOffset = currZpos * (currImgWidth*currImgHeight); + buffZOffset = currZpos * ((long)currImgWidth*(long)currImgHeight); // if image is multisample, worry about current sample if (p->comp < 0) @@ -2723,9 +2723,9 @@ if (currImgNbSamples == 1) { dbgprintf("Expected number of samples: 1\n"); *imDepth = 3; - *outbuf = new uchar[3*currImgWidth*currImgHeight]; + *outbuf = new uchar[3*(long)currImgWidth*(long)currImgHeight]; p = *outbuf; - end = *outbuf + 3*currImgWidth * currImgHeight; + end = *outbuf + 3*(long)currImgWidth * (long)currImgHeight; q = (uchar *)(currBuffp[0]) + buffZOffset; while (p < end) { @@ -2750,9 +2750,9 @@ if (imspp == 1) { dbgprintf("Expected number of samples: 1\n"); *imDepth = 3; - *outbuf = new uchar[3*currImgWidth*currImgHeight]; + *outbuf = new uchar[3*(long)currImgWidth*(long)currImgHeight]; p = *outbuf; - end = *outbuf + 3*currImgWidth * currImgHeight; + end = *outbuf + 3*(long)currImgWidth * (long)currImgHeight; q = imdata; while (p < end) { @@ -2780,9 +2780,9 @@ if (currImgNbSamples == 1) { dbgprintf("Expected number of samples: 1\n"); *imDepth = 3; - *outbuf = new uchar[3*currImgWidth*currImgHeight]; + *outbuf = new uchar[3*(long)currImgWidth*(long)currImgHeight]; p = *outbuf; - end = *outbuf + 3*currImgWidth * currImgHeight; + end = *outbuf + 3*(long)currImgWidth * (long)currImgHeight; q = (int *)(currBuffp[0]) + buffZOffset; while (p < end) { @@ -2819,9 +2819,9 @@ dbgprintf("Pixel type is arbitrary, of size %d, CLUT is present, %d samples present\n", sizeof(T), currImgNbSamples); *imDepth = 3; - *outbuf = new uchar[3*currImgWidth*currImgHeight]; + *outbuf = new uchar[3*(long)currImgWidth*(long)currImgHeight]; p = *outbuf; - end = *outbuf + 3*currImgWidth * currImgHeight; + end = *outbuf + 3*(long)currImgWidth * (long)currImgHeight; q = (T *)(currBuffp[currComp]) + buffZOffset; while (p < end) { @@ -2844,10 +2844,10 @@ if (currImgNbSamples >= 1) { // nothing much to do: save first buffer to outbuff *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; p = *outbuf; q = (uchar *)(currBuffp[currComp]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; while (p != end) *p++ = (*q++) ? 0 : 255; if ((currImgNbSamples == 1) && (currImgThickness == 1)) { @@ -2876,8 +2876,8 @@ if (currImgNbSamples == 1) { // probably the simplest of all cases: *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; - memcpy(*outbuf, (char *)(currBuffp[0]) + buffZOffset, currImgWidth * currImgHeight); + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; + memcpy(*outbuf, (char *)(currBuffp[0]) + buffZOffset, (long)currImgWidth * (long)currImgHeight); if ((currImgThickness == 1) && freeBuffers) freeCurrentBuffers(); } else if (interpretRGB && (currImgNbSamples == 3)) { @@ -2886,14 +2886,14 @@ dbgprintf("Interpreting image as RGB even though it isn't...\n"); } *imDepth = 3; - *outbuf = new uchar[currImgNbSamples*currImgWidth*currImgHeight]; + *outbuf = new uchar[currImgNbSamples*(long)currImgWidth*(long)currImgHeight]; p = *outbuf; - end = *outbuf + currImgNbSamples*currImgWidth * currImgHeight; + end = *outbuf + currImgNbSamples*(long)currImgWidth * (long)currImgHeight; qR = (uchar *)(currBuffp[0]) + buffZOffset; qG = (uchar *)(currBuffp[1]) + buffZOffset; qB = (uchar *)(currBuffp[2]) + buffZOffset; - while (p != end) { + while (p < end) { *p++ = *qR++; *p++ = *qG++; *p++ = *qB++; @@ -2903,8 +2903,8 @@ } else if (currImgNbSamples > 0) { // display only the current sample *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; - memcpy(*outbuf, (char *)(currBuffp[currComp]) + buffZOffset, currImgWidth * currImgHeight); + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; + memcpy(*outbuf, (char *)(currBuffp[currComp]) + buffZOffset, (long)currImgWidth * (long)currImgHeight); dbgprintf("There are %d uchar buffers in this image\n", currImgNbSamples); // don't free the Buffers as we may need them... } else { @@ -2947,14 +2947,14 @@ if (currImgNbSamples == 1) { *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; // adjust values if (minmaxAllSlices) { p = (T *)(currBuffp[0]); - end = p + currImgWidth * currImgHeight * currImgThickness; + end = p + (long)currImgWidth * (long)currImgHeight * currImgThickness; } else { p = (T *)(currBuffp[0]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; } if (minmaxAllSlices && minmax_iscached()) { dbgprintf("Using cached min/max values\n"); @@ -2980,7 +2980,7 @@ dbgprintf("Nbsamples = 1 ; min = %f , max = %f\n", (double)minval, (double)maxval); p = (T *)(currBuffp[0]) + buffZOffset; q = *outbuf; - endq = q + currImgWidth * currImgHeight; + endq = q + (long)currImgWidth * (long)currImgHeight; if (makeChar && (minval >= nada) && (maxval <= 255)) { // this image fits in a char, just copy things through while (q < endq) { @@ -3007,7 +3007,7 @@ dbgprintf("Interpreting image as RGB even though it isn't...\n"); } *imDepth = 3; - *outbuf = new uchar[currImgNbSamples*currImgWidth*currImgHeight]; + *outbuf = new uchar[(long)currImgNbSamples*(long)currImgWidth*(long)currImgHeight]; if (minmaxAllSlices && minmax_iscached()) { double cmin, cmax; @@ -3024,10 +3024,10 @@ for (i = 0 ; i < currImgNbSamples ; i++) { if (minmaxAllSlices) { p = (T *)(currBuffp[i]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; } else { p = (T *)(currBuffp[i]); - end = p + currImgWidth * currImgHeight * currImgThickness; + end = p + (long)currImgWidth * (long)currImgHeight * currImgThickness; } while (p < end) { if (*p > maxval) @@ -3047,7 +3047,7 @@ pG = (T *)(currBuffp[1]) + buffZOffset; pB = (T *)(currBuffp[2]) + buffZOffset; q = *outbuf; - endq = q + currImgNbSamples*currImgWidth*currImgHeight; + endq = q + currImgNbSamples*(long)currImgWidth*(long)currImgHeight; if (makeChar && (minval >= nada && maxval <= 255)) { // this image fits on a char: just copy things through while (q < endq) { @@ -3080,7 +3080,7 @@ } else if (currImgNbSamples > 0) { // display only the current sample *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; // adjust values if (minmaxAllSlices && minmax_iscached()) { double cmin, cmax; @@ -3100,10 +3100,10 @@ for (i = 0 ; i < currImgNbSamples ; i++) { if (minmaxAllSlices) { p = (T *)(currBuffp[i]); - end = p + currImgWidth * currImgHeight * currImgThickness; + end = p + (long)currImgWidth * (long)currImgHeight * currImgThickness; } else { p = (T *)(currBuffp[i]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; } while (p < end) { if (*p > maxval) @@ -3117,11 +3117,11 @@ if (minmaxAllSlices) { minval = maxval = *((T *)currBuffp[currComp]); p = (T *)(currBuffp[currComp]); - end = p + currImgWidth * currImgHeight * currImgThickness; + end = p + (long)currImgWidth * (long)currImgHeight * currImgThickness; } else { minval = maxval = *(((T *)currBuffp[currComp]) + buffZOffset); p = (T *)(currBuffp[currComp]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; } while (p < end) { if (*p > maxval) @@ -3141,7 +3141,7 @@ // just worry about the current sample for display p = (T *)(currBuffp[currComp]) + buffZOffset; q = *outbuf; - endq = q + currImgWidth * currImgHeight; + endq = q + (long)currImgWidth * (long)currImgHeight; if (makeChar && (minval >= nada && maxval <= 255)) { // this image fits in a char, just copy things through while (q < endq) { @@ -3183,10 +3183,10 @@ dbgprintf("Pixel type is int2 (short)\n"); if (currImgNbSamples == 1) { *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; // adjust values p = (short *)(currBuffp[0]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; minval = maxval = *p++; while (p < end) { if (*p > maxval) @@ -3197,7 +3197,7 @@ } p = (short *)(currBuffp[0]) + buffZOffset; q = *outbuf; - endq = q + currImgWidth * currImgHeight; + endq = q + (long)currImgWidth * (long)currImgHeight; if (minval >= 0 && maxval <= 255) { // this `short' image fits in a char, just copy things through while (q < endq) { @@ -3224,12 +3224,12 @@ dbgprintf("Interpreting image as RGB even though it isn't...\n"); } *imDepth = 3; - *outbuf = new uchar[currImgNbSamples*currImgWidth*currImgHeight]; + *outbuf = new uchar[(long)currImgNbSamples*(long)currImgWidth*(long)currImgHeight]; minval = maxval = *((short *)(currBuffp[0]) + buffZOffset); for (i = 0 ; i < currImgNbSamples ; i++) { p = (short *)(currBuffp[i]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; while (p < end) { if (*p > maxval) maxval = *p; @@ -3242,7 +3242,7 @@ pG = (short *)(currBuffp[1]) + buffZOffset; pB = (short *)(currBuffp[2]) + buffZOffset; q = *outbuf; - endq = q + currImgNbSamples*currImgWidth*currImgHeight; + endq = q + (long)currImgNbSamples*(long)currImgWidth*(long)currImgHeight; if (minval >= 0 && maxval <= 255) { // this image fits on a char: just copy things through while (q < endq) { @@ -3275,13 +3275,13 @@ } else if (currImgNbSamples > 0) { // display only the current sample *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; // adjust values minval = maxval = *(((short *)currBuffp[currComp]) + buffZOffset); // take the min and max across all samples! for (i = 0 ; i < currImgNbSamples ; i++) { p = (short *)(currBuffp[i]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; while (p < end) { if (*p > maxval) maxval = *p; @@ -3292,7 +3292,7 @@ } p = (short *)(currBuffp[currComp]) + buffZOffset; q = *outbuf; - endq = q + currImgWidth * currImgHeight; + endq = q + (long)currImgWidth * (long)currImgHeight; if (minval >= 0 && maxval <= 255) { // this `short' image fits in a char, just copy things through while (q < endq) { @@ -3333,10 +3333,10 @@ dbgprintf("Pixel type is int2 (unsigned short)\n"); if (currImgNbSamples == 1) { *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; // adjust values p = (unsigned short *)(currBuffp[0]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; minval = maxval = *p++; while (p < end) { if (*p > maxval) @@ -3347,7 +3347,7 @@ } p = (unsigned short *)(currBuffp[0]) + buffZOffset; q = *outbuf; - endq = q + currImgWidth * currImgHeight; + endq = q + (long)currImgWidth * (long)currImgHeight; if (maxval <= 255) { // this `unsigned short' image fits in a char, just copy things through while (q < endq) { @@ -3374,7 +3374,7 @@ dbgprintf("Interpreting image as RGB even though it isn't...\n"); } *imDepth = 3; - *outbuf = new uchar[currImgNbSamples*currImgWidth*currImgHeight]; + *outbuf = new uchar[currImgNbSamples*(long)currImgWidth*(long)currImgHeight]; minval = maxval = *((unsigned short *)(currBuffp[0]) + buffZOffset); for (i = 0 ; i < currImgNbSamples ; i++) { @@ -3392,7 +3392,7 @@ pG = (unsigned short *)(currBuffp[1]) + buffZOffset; pB = (unsigned short *)(currBuffp[2]) + buffZOffset; q = *outbuf; - endq = q + currImgNbSamples*currImgWidth*currImgHeight; + endq = q + currImgNbSamples*(long)currImgWidth*(long)currImgHeight; if (maxval <= 255) { // this image fits on a char: just copy things through while (q < endq) { @@ -3425,13 +3425,13 @@ } else if (currImgNbSamples > 0) { // display only the current sample *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; // adjust values minval = maxval = *(((unsigned short *)currBuffp[currComp]) + buffZOffset); // take the min and max across all samples! for (i = 0 ; i < currImgNbSamples ; i++) { p = (unsigned short *)(currBuffp[i]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; while (p < end) { if (*p > maxval) maxval = *p; @@ -3442,7 +3442,7 @@ } p = (unsigned short *)(currBuffp[currComp]) + buffZOffset; q = *outbuf; - endq = q + currImgWidth * currImgHeight; + endq = q + (long)currImgWidth * (long)currImgHeight; if (maxval <= 255) { // this `unsigned short' image fits in a char, just copy things through while (q < endq) { @@ -3484,10 +3484,10 @@ dbgprintf("Pixel type is int4\n"); if (currImgNbSamples == 1) { *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; // adjust values p = (unsigned int*)(currBuffp[0]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; minval = maxval = *p++; while (p < end) { if (*p > maxval) @@ -3498,7 +3498,7 @@ } p = (unsigned int*)(currBuffp[0]) + buffZOffset; q = *outbuf; - endq = q + currImgWidth * currImgHeight; + endq = q + (long)currImgWidth * (long)currImgHeight; if (maxval <= 255) { // this `int' image fits in a char, just copy things through while (q < endq) { @@ -3525,12 +3525,12 @@ dbgprintf("Interpreting image as RGB even though it isn't...\n"); } *imDepth = 3; - *outbuf = new uchar[currImgNbSamples*currImgWidth*currImgHeight]; + *outbuf = new uchar[(long)currImgNbSamples*(long)currImgWidth*(long)currImgHeight]; minval = maxval = *((unsigned int*)(currBuffp[0]) + buffZOffset); for (i = 0 ; i < currImgNbSamples ; i++) { p = (unsigned int*)(currBuffp[i]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; while (p < end) { if (*p > maxval) maxval = *p; @@ -3543,7 +3543,7 @@ pG = (unsigned int*)(currBuffp[1]) + buffZOffset; pB = (unsigned int*)(currBuffp[2]) + buffZOffset; q = *outbuf; - endq = q + currImgNbSamples*currImgWidth*currImgHeight; + endq = q + currImgNbSamples*(long)currImgWidth*(long)currImgHeight; if (maxval <= 255) { // this image fits on a char: just copy things through while (q < endq) { @@ -3576,13 +3576,13 @@ } else if (currImgNbSamples > 0) { // display only the current sample *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; // adjust values minval = maxval = *((unsigned int*)currBuffp[currComp] + buffZOffset); // take the min and max across all samples! for (i = 0 ; i < currImgNbSamples ; i++) { p = (unsigned int*)(currBuffp[i]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; while (p < end) { if (*p > maxval) maxval = *p; @@ -3593,7 +3593,7 @@ } p = (unsigned int*)(currBuffp[currComp]) + buffZOffset; q = *outbuf; - endq = q + currImgWidth * currImgHeight; + endq = q + (long)currImgWidth * (long)currImgHeight; if (maxval <= 255) { // this `int' image fits in a char, just copy things through while (q < endq) { @@ -3633,10 +3633,10 @@ dbgprintf("Pixel type is int4\n"); if (currImgNbSamples == 1) { *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; // adjust values p = (int *)(currBuffp[0]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; minval = maxval = *p++; while (p < end) { if (*p > maxval) @@ -3647,7 +3647,7 @@ } p = (int *)(currBuffp[0]) + buffZOffset; q = *outbuf; - endq = q + currImgWidth * currImgHeight; + endq = q + (long)currImgWidth * (long)currImgHeight; if (minval >= 0 && maxval <= 255) { // this `int' image fits in a char, just copy things through while (q < endq) { @@ -3674,12 +3674,12 @@ dbgprintf("Interpreting image as RGB even though it isn't...\n"); } *imDepth = 3; - *outbuf = new uchar[currImgNbSamples*currImgWidth*currImgHeight]; + *outbuf = new uchar[currImgNbSamples*(long)currImgWidth*(long)currImgHeight]; minval = maxval = *((int *)(currBuffp[0]) + buffZOffset); for (i = 0 ; i < currImgNbSamples ; i++) { p = (int *)(currBuffp[i]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; while (p < end) { if (*p > maxval) maxval = *p; @@ -3692,7 +3692,7 @@ pG = (int *)(currBuffp[1]) + buffZOffset; pB = (int *)(currBuffp[2]) + buffZOffset; q = *outbuf; - endq = q + currImgNbSamples*currImgWidth*currImgHeight; + endq = q + currImgNbSamples*(long)currImgWidth*(long)currImgHeight; if (minval >= 0 && maxval <= 255) { // this image fits on a char: just copy things through while (q < endq) { @@ -3725,13 +3725,13 @@ } else if (currImgNbSamples > 0) { // display only the current sample *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; // adjust values minval = maxval = *(((int *)currBuffp[currComp]) + buffZOffset); // take the min and max across all samples! for (i = 0 ; i < currImgNbSamples ; i++) { p = (int *)(currBuffp[i]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; while (p < end) { if (*p > maxval) maxval = *p; @@ -3742,7 +3742,7 @@ } p = (int *)(currBuffp[currComp]) + buffZOffset; q = *outbuf; - endq = q + currImgWidth * currImgHeight; + endq = q + (long)currImgWidth * (long)currImgHeight; if (minval >= 0 && maxval <= 255) { // this `int' image fits in a char, just copy things through while (q < endq) { @@ -3783,10 +3783,10 @@ dbgprintf("Pixel type is double\n"); if (currImgNbSamples == 1) { *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; // adjust values p = (double *)(currBuffp[0]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; minval = maxval = *p++; while (p < end) { if (*p > maxval) @@ -3797,7 +3797,7 @@ } p = (double *)(currBuffp[0]) + buffZOffset; q = *outbuf; - endq = q + currImgWidth * currImgHeight; + endq = q + (long)currImgWidth * (long)currImgHeight; if (maxval != minval) while (q < endq) { *q++ = (uchar)((((*p++) - minval) * 255.0)/(maxval-minval)); @@ -3812,12 +3812,12 @@ dbgprintf("Interpreting image as RGB even though it isn't...\n"); } *imDepth = 3; - *outbuf = new uchar[currImgNbSamples*currImgWidth*currImgHeight]; + *outbuf = new uchar[currImgNbSamples*(long)currImgWidth*(long)currImgHeight]; minval = maxval = *((double *)(currBuffp[0]) + buffZOffset); for (i = 0 ; i < currImgNbSamples ; i++) { p = (double *)(currBuffp[i]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; while (p < end) { if (*p > maxval) maxval = *p; @@ -3830,7 +3830,7 @@ pG = (double *)(currBuffp[1]) + buffZOffset; pB = (double *)(currBuffp[2]) + buffZOffset; q = *outbuf; - endq = q + currImgNbSamples*currImgWidth*currImgHeight; + endq = q + currImgNbSamples*(long)currImgWidth*(long)currImgHeight; if (maxval != minval) { // doesn't fit on a char: do a grey-level scaling while (q < endq) { @@ -3849,13 +3849,13 @@ } else if (currImgNbSamples > 0) { // display only the current sample *imDepth = 1; - *outbuf = new uchar[currImgWidth * currImgHeight]; + *outbuf = new uchar[(long)currImgWidth * (long)currImgHeight]; // adjust values minval = maxval = *(((double *)currBuffp[currComp]) + buffZOffset); // take the min and max across all samples! for (i = 0 ; i < currImgNbSamples ; i++) { p = (double *)(currBuffp[i]) + buffZOffset; - end = p + currImgWidth * currImgHeight; + end = p + (long)currImgWidth * (long)currImgHeight; while (p < end) { if (*p > maxval) maxval = *p; @@ -3867,7 +3867,7 @@ dbgprintf("Double image, range: min=%.6g, max=%.6g\n", minval, maxval); p = (double *)(currBuffp[currComp]) + buffZOffset; q = *outbuf; - endq = q + currImgWidth * currImgHeight; + endq = q + (long)currImgWidth * (long)currImgHeight; if (maxval != minval) while (q < endq) { *q++ = (uchar)((((*p++) - minval) * 255)/(maxval-minval)); --- a/imnmspc.hxx +++ b/imnmspc.hxx @@ -37,6 +37,7 @@ * * For those compilers that require the namespace definition. * At the moment, this only counts MSVC++ + * (GCC-4 now requires namespace statements as well - Teemu Ikonen 2006-07-06) * *-----------------------------------------------------------------------*/ @@ -44,13 +45,14 @@ #ifndef IMNAMESPACE_H #define IMNAMESPACE_H -#if defined(_MSC_VER) // Visual C++ - namespace std { // empty here } using namespace std; + +#if defined(_MSC_VER) // Visual C++ + // suppress warning about identifier being too long to be debugged... #pragma warning(disable:4786) --- a/imlines.cxx +++ b/imlines.cxx @@ -129,7 +129,7 @@ int id = IOBlackBox->imageDepth(); if (id != 1) { uchar *dp; - dp = IOBlackBox->imageData() + id * delta; + dp = IOBlackBox->imageData() + id * (long)delta; aPoint.R = *dp; aPoint.G = *(dp+1); aPoint.B = *(dp+2); --- a/imageViewer.cxx +++ b/imageViewer.cxx @@ -163,6 +163,9 @@ // must call this to close the group end(); + + parentWindow = (imviewWindow *)parent(); + } imageViewer::~imageViewer() --- a/imageIO.cxx +++ b/imageIO.cxx @@ -629,7 +629,7 @@ || (thepixtype == IM_UINT4)) { if (imspp == 1) { // image is OK, render in buffer - uchar *ovl = new uchar[w*h*z]; + uchar *ovl = new uchar[(long)w*(long)h*(long)z]; switch (thepixtype) { case IM_BINARY: @@ -637,7 +637,7 @@ case IM_UINT1: { char **b = (char **)p; - memcpy(ovl, b[0], w * h * z * sizeof(uchar)); + memcpy(ovl, b[0], (long)w * (long)h * (long)z * sizeof(uchar)); } break; @@ -649,7 +649,7 @@ ovlb = ovl; begin = b[0]; - end = begin + w * h * z; + end = begin + (long)w * (long)h * (long)z; while (begin != end) *ovlb++ = *begin++ & 0xFF; @@ -665,7 +665,7 @@ ovlb = ovl; begin = b[0]; - end = begin + w * h * z; + end = begin + (long)w * (long)h * (long)z; while (begin != end) *ovlb++ = *begin++ & 0xFF; @@ -681,7 +681,7 @@ ovlb = ovl; begin = b[0]; - end = begin + w * h * z; + end = begin + (long)w * (long)h * (long)z; while (begin != end) *ovlb++ = *begin++ & 0xFF; @@ -697,7 +697,7 @@ ovlb = ovl; begin = b[0]; - end = begin + w * h * z; + end = begin + (long)w * (long)h * (long)z; while (begin != end) *ovlb++ = *begin++ & 0xFF; @@ -719,7 +719,7 @@ } } else if (imspp == 3) { // image is OK, render in buffer - uchar *ovl = new uchar[3*w*h*z]; + uchar *ovl = new uchar[3*(long)w*(long)h*(long)z]; int i; // overlay buffer will be arranged RGBRGBRGB... @@ -734,7 +734,7 @@ for (i = 0 ; i < 3 ; i++) { begin = b[i]; - end = begin + w * h * z; + end = begin + (long)w * (long)h * (long)z; ovlb = ovl+i; while(begin != end) { @@ -753,7 +753,7 @@ for (i = 0 ; i < 3 ; i++) { begin = b[i]; - end = begin + w * h * z; + end = begin + (long)w * (long)h * (long)z; ovlb = ovl+i; while(begin != end) { @@ -773,7 +773,7 @@ for (i = 0 ; i < 3 ; i++) { begin = b[i]; - end = begin + w * h * z; + end = begin + (long)w * (long)h * (long)z; ovlb = ovl+i; while(begin != end) { @@ -792,7 +792,7 @@ for (i = 0 ; i < 3 ; i++) { begin = b[i]; - end = begin + w * h * z; + end = begin + (long)w * (long)h * (long)z; ovlb = ovl+i; while(begin != end) { @@ -811,7 +811,7 @@ for (i = 0 ; i < 3 ; i++) { begin = b[i]; - end = begin + w * h * z; + end = begin + (long)w * (long)h * (long)z; ovlb = ovl+i; while(begin != end) { @@ -868,7 +868,7 @@ int imageIO::wholeImage(uchar **bufR, uchar **bufG, uchar **bufB) { - int nbpix = currImgWidth*currImgHeight; + long nbpix = (long)currImgWidth*(long)currImgHeight; if (imspp == 1) { // simply return a copy of the image data @@ -909,13 +909,13 @@ if (imspp == 1) { int j; uchar *ucp, *ucpl; - long nbpix = bh*bw; + long nbpix = (long)bh*(long)bw; *bufR = new uchar[nbpix]; *bufG = *bufB = 0; for (j = 0 ; j < bh ; j++) { - ucp = imdata + (by+j)*currImgWidth + bx; - ucpl = *bufR + j*bw; + ucp = imdata + (by+j)*(long)currImgWidth + bx; + ucpl = *bufR + j*(long)bw; memcpy(ucpl, ucp, bw); } } else if (imspp == 3) { @@ -928,10 +928,10 @@ *bufB = new uchar[nbpix]; for (j = 0 ; j < bh ; j++) { - ucp = imdata + 3*((by+j)*currImgWidth + bx); - ucpr = *bufR + j*bw; - ucpg = *bufG + j*bw; - ucpb = *bufB + j*bw; + ucp = imdata + 3*((by+j)*(long)currImgWidth + bx); + ucpr = *bufR + j*(long)bw; + ucpg = *bufG + j*(long)bw; + ucpb = *bufB + j*(long)bw; for (i = 0 ; i < bw ; i++) { *ucpr++ = *ucp++; *ucpg++ = *ucp++; @@ -972,13 +972,13 @@ case IM_UINT1: case IM_INT1: { uchar *ucpX, *ucpY; - ucpX = (uchar*)currBuffp[Xcomp] + zoff + currImgWidth*by + bx; - ucpY = (uchar*)currBuffp[Ycomp] + zoff + currImgWidth*by + bx; + ucpX = (uchar*)currBuffp[Xcomp] + zoff + (long)currImgWidth*(long)by + bx; + ucpY = (uchar*)currBuffp[Ycomp] + zoff + (long)currImgWidth*(long)by + bx; minXval = maxXval = (double)*ucpX; minYval = maxYval = (double)*ucpY; for (j = 0 ; j < bh ; j++) { - ucpX = (uchar*)currBuffp[Xcomp] + zoff + currImgWidth*(by+j) + bx; - ucpY = (uchar*)currBuffp[Ycomp] + zoff + currImgWidth*(by+j) + bx; + ucpX = (uchar*)currBuffp[Xcomp] + zoff + (long)currImgWidth*(long)(by+j) + bx; + ucpY = (uchar*)currBuffp[Ycomp] + zoff + (long)currImgWidth*(long)(by+j) + bx; for (i = 0 ; i < bw ; i++) { dx = (double)*ucpX; dy = (double)*ucpY; @@ -1000,13 +1000,13 @@ case IM_INT4: case IM_UINT4: { int *ucpX, *ucpY; - ucpX = (int*)currBuffp[Xcomp] + zoff + currImgWidth*by + bx; - ucpY = (int*)currBuffp[Ycomp] + zoff + currImgWidth*by + bx; + ucpX = (int*)currBuffp[Xcomp] + zoff + (long)currImgWidth*(long)by + bx; + ucpY = (int*)currBuffp[Ycomp] + zoff + (long)currImgWidth*(long)by + bx; minXval = maxXval = (double)*ucpX; minYval = maxYval = (double)*ucpY; for (j = 0 ; j < bh ; j++) { - ucpX = (int*)currBuffp[Xcomp] + zoff + currImgWidth*(by+j) + bx; - ucpY = (int*)currBuffp[Ycomp] + zoff + currImgWidth*(by+j) + bx; + ucpX = (int*)currBuffp[Xcomp] + zoff + (long)currImgWidth*(long)(by+j) + bx; + ucpY = (int*)currBuffp[Ycomp] + zoff + (long)currImgWidth*(long)(by+j) + bx; for (i = 0 ; i < bw ; i++) { dx = (double)*ucpX; dy = (double)*ucpY; @@ -1016,7 +1016,7 @@ if (dx > maxXval) maxXval = dx; if (dy > maxYval) maxYval = dy; - delta = bx+i + (by+j)*currImgWidth; + delta = bx+i + (long)(by+j)*(long)currImgWidth; v.push_back(BHPoint(BHPBlack,delta,dx ,dy)); ucpX++; ucpY++; @@ -1027,13 +1027,13 @@ case IM_DOUBLE: { double *ucpX, *ucpY; - ucpX = (double*)currBuffp[Xcomp] + zoff + currImgWidth*by + bx; - ucpY = (double*)currBuffp[Ycomp] + zoff + currImgWidth*by + bx; + ucpX = (double*)currBuffp[Xcomp] + zoff + (long)currImgWidth*(long)by + bx; + ucpY = (double*)currBuffp[Ycomp] + zoff + (long)currImgWidth*(long)by + bx; minXval = maxXval = (double)*ucpX; minYval = maxYval = (double)*ucpY; for (j = 0 ; j < bh ; j++) { - ucpX = (double*)currBuffp[Xcomp] + zoff + currImgWidth*(by+j) + bx; - ucpY = (double*)currBuffp[Ycomp] + zoff + currImgWidth*(by+j) + bx; + ucpX = (double*)currBuffp[Xcomp] + zoff + (long)currImgWidth*(long)(by+j) + bx; + ucpY = (double*)currBuffp[Ycomp] + zoff + (long)currImgWidth*(long)(by+j) + bx; for (i = 0 ; i < bw ; i++) { dx = *ucpX; dy = *ucpY; @@ -1043,7 +1043,7 @@ if (dx > maxXval) maxXval = dx; if (dy > maxYval) maxYval = dy; - delta = bx+i + (by+j)*currImgWidth; + delta = bx+i + (long)(by+j)*(long)currImgWidth; v.push_back(BHPoint(BHPBlack,delta,dx ,dy)); ucpX++; ucpY++; @@ -1064,7 +1064,7 @@ minXval = maxXval = (double)*(beg + Xcomp); minYval = maxYval = (double)*(beg + Ycomp); for (j = 0 ; j < bh ; j++) { - beg = imdata + currImgNbSamples*((by+j)*currImgWidth + bx); + beg = imdata + currImgNbSamples*((long)(by+j)*(long)currImgWidth + bx); ucpX = beg + Xcomp; ucpY = beg + Ycomp; for (i = 0 ; i < bw ; i++) { @@ -1076,7 +1076,7 @@ if (dx > maxXval) maxXval = dx; if (dy > maxYval) maxYval = dy; - delta = bx+i + (by+j)*currImgWidth; + delta = bx+i + (long)(by+j)*(long)currImgWidth; v.push_back(BHPoint(BHPBlack,delta,dx ,dy)); ucpX += currImgNbSamples; ucpY += currImgNbSamples; --- a/configure.in +++ b/configure.in @@ -438,16 +438,22 @@ if test "$have_x" = "yes" ; then dnl some headers might be poorly defined, in particular regarding X11 headers and Solaris (things have improved lately) # Check for X - AC_PATH_XTRA +# This macro causes an unused dependency to libXt. In Debian, the fltk +# build dependency should pull in all the needed X gunk, but no more. +# - TI 2006-07-06 +# AC_PATH_XTRA +# Adding empty X_EXTRA_LIBS + AC_SUBST(X_EXTRA_LIBS, "") + echo "Ignoring libraries \"$X_PRE_LIBS\" requested by configure." dnl# LIBS="$LIBS$X_LIBS$X_PRE_LIBS" if test "$with_magick" != "no" ; then # this seems to be sufficient somehow # as Magick will include the right libraries and flags already - XLIBS="-lX11 -lXext" + XLIBS="-lX11 -lXext -lXpm" else # I'm not sure how reliable this is... - XLIBS="$X_LIBS -lX11 -lXext" + XLIBS="$X_LIBS -lX11 -lXext -lXpm" fi # LIBS="$LIBS$X_LIBS" CFLAGS="$CFLAGS $X_CFLAGS" @@ -466,7 +472,6 @@ dnl# do this last so messing with switches does not break tests if test -n "$GXX"; then GCC_ACCEPTS_INCLUDE_DIR # this will add -I$INCLUDE_DIR if the compiler does not complain about it. - GCC_ACCEPTS_DEPRECATED_HEADERS # this will test if -Wno-deprecated is necessary CFLAGS="-Wall $CFLAGS" # GNU C++ is sometimes missing bits of the STL @@ -744,29 +749,36 @@ dnl ImageMagick is very useful, but optional dnl Moreover the API keeps changing and that's really annoying. +# Use pkg-config instead of Magick-config (-TI 2005-12-01) if test "$with_magick" != "no" then MAGICKLIB='' # check if we can find the configuration utility - AC_CHECK_PROG(HAVE_MAGICK_CONFIG, Magick-config, "yes", "no") +# AC_CHECK_PROG(HAVE_MAGICK_CONFIG, Magick-config, "yes", "no") + HAVE_MAGICK_CONFIG="yes" if test "$HAVE_MAGICK_CONFIG" != "no" then # verify that Magick associated libraries are not incompatible - if test "$have_x" != "yes" -a "`Magick-config --libs | grep X11`" != "" ; then +# if test "$have_x" != "yes" -a "`Magick-config --libs | grep X11`" != "" ; then + if test "$have_x" != "yes" ; then # conflict echo "Magick library conflicts with requested absence of X11 library usage" with_magick=no else # this might turn really ugly - CPPFLAGS="$CPPFLAGS "`Magick-config --cppflags` - LDFLAGS="$LDFLAGS "`Magick-config --ldflags` - IMLIBS="$IMLIBS "`Magick-config --libs` +# CPPFLAGS="$CPPFLAGS "`Magick-config --cppflags` +# LDFLAGS="$LDFLAGS "`Magick-config --ldflags` +# IMLIBS="$IMLIBS "`Magick-config --libs` + MAGICKNAME=$(pkg-config ImageMagick --libs-only-l | sed 's/-l//') + CPPFLAGS="$CPPFLAGS "`pkg-config ImageMagick --cflags` + LDFLAGS="$LDFLAGS "`pkg-config ImageMagick --libs-only-L` + IMLIBS="$IMLIBS "`pkg-config ImageMagick --libs` # we are not finished: we must check we have the correct version - AC_CHECK_LIB(Magick, DispatchImage, - AC_DEFINE(HAVE_MAGICK) MAGICKLIB=" -lMagick", + AC_CHECK_LIB($MAGICKNAME, DispatchImage, + AC_DEFINE(HAVE_MAGICK) MAGICKLIB=" -l$MAGICKNAME", MAGICKLIB="", $IMLIBS) - if test "$MAGICKLIB" != " -lMagick" ; then + if test "$MAGICKLIB" != " -l$MAGICKNAME" ; then echo "Magick library found, but version is incorrect, we need version 5.x ; 6.x is not supported at this stage." with_magick="no" else @@ -851,7 +863,7 @@ dnl Installation stuff -eval PrefPath="${DATA_DIR}/Imview/" +eval PrefPath="${DATA_DIR}/imview/" AC_DEFINE_UNQUOTED(PrefPath,"$PrefPath",Define directory where preference and .lut files will live.) # optional --- a/bivHist.cxx +++ b/bivHist.cxx @@ -45,7 +45,9 @@ #include #include // for sprintf +#include +#include #include #include "imview.hxx" --- a/Makefile.in +++ b/Makefile.in @@ -19,11 +19,11 @@ top_srcdir = @top_srcdir@ srcdir = @srcdir@ bindir = $(exec_prefix)/bin -infodir = $(prefix)/info +infodir = @infodir@ libdir = $(prefix)/lib/gnudl -mandir = $(prefix)/man/man1 +mandir = @mandir@/man1 datadir = @datadir@ -datadestdir = $(datadir)/Imview +datadestdir = $(datadir)/imview # compilers and flags CC = @CC@ @@ -174,7 +174,7 @@ $(TARGET) : $(UILIB) $(IOLIB) $(SRVLIB) $(OBJECTS) $(SENTINEL) $(CXX) $(STATIC) $(CXXTRA) $(CXXFLAGS) -o $(TARGET) $(OBJECTS) $(UILIB) $(IOLIB) $(SRVLIB) $(LDFLAGS) $(LDLIBS) $(LDXTRA) $(FENCE) $(FLTK_CONFIG) --post $(TARGET) - @(cd ${TOP} ; ./buildnb) +# @(cd ${TOP} ; ./buildnb) $(UILIB): (cd fluid ; $(MAKE) ) @@ -217,20 +217,20 @@ install-lut: @$(mkinstalldirs) $(DESTDIR)$(datadestdir) @for i in ${top_srcdir}/support/*.lut ${top_srcdir}/support/*.jpg ; do \ - ${INSTALL} $$i $(DESTDIR)$(datadestdir)/ ;\ + ${INSTALL} --mode="u=rw,go=r" $$i $(DESTDIR)$(datadestdir)/ ;\ done install-help: @$(mkinstalldirs) $(DESTDIR)$(datadestdir)/doc @for i in ${top_srcdir}/doc/quickhelp*.html ; do \ - ${INSTALL} $$i $(DESTDIR)$(datadestdir)/doc/ ;\ + ${INSTALL} --mode="u=rw,go=r" $$i $(DESTDIR)$(datadestdir)/doc/ ;\ done @-${INSTALL} -d $(DESTDIR)$(datadestdir) - @-${INSTALL} ${top_srcdir}/doc/gpl.html $(DESTDIR)$(datadestdir)/doc/ - @-${INSTALL} ${top_srcdir}/doc/warranty.html $(DESTDIR)$(datadestdir)/doc/ + @-${INSTALL} --mode="u=rw,go=r" ${top_srcdir}/doc/gpl.html $(DESTDIR)$(datadestdir)/doc/ + @-${INSTALL} --mode="u=rw,go=r" ${top_srcdir}/doc/warranty.html $(DESTDIR)$(datadestdir)/doc/ @-${INSTALL} -d $(DESTDIR)$(mandir) @-${INSTALL} ${top_srcdir}/doc/imview.1 $(DESTDIR)$(mandir)/ - @gzip $(DESTDIR)$(mandir)/imview.1 + @gzip -9 $(DESTDIR)$(mandir)/imview.1 # strip executables before installing. install-strip: install-lut install-help --- a/COPYRIGHT +++ b/COPYRIGHT @@ -16,8 +16,7 @@ A copy of the GNU General Public License is available in the file COPYING. If you did not receive it, write to: - The Free Software Foundation - 59 Temple Place - Suite 330 - Boston, MA 02111, USA - + Free Software Foundation, Inc. + 51 Franklin St + Fifth Floor + Boston, MA 02110-1301, USA. --- a/server/interpreter.hxx +++ b/server/interpreter.hxx @@ -100,11 +100,11 @@ }; // much-needed authentication -class user:public action{ +class interpreter_user:public action{ string server_user; // who is running the server now? // static bool matches; public: - user(void); // constructor + interpreter_user(void); // constructor // static bool unauthenticate(void) {matches = false;} // static bool authenticated(void) {return matches;} int perform(vector &l, string &result); --- a/server/interpreter.cxx +++ b/server/interpreter.cxx @@ -336,7 +336,7 @@ //bool user::matches = false; // no one is authenticated by default -user::user(void) { +interpreter_user::interpreter_user(void) { // find out who is running the show // this is a bit flaky, but should do for now. Proper security will // be for later. @@ -379,7 +379,7 @@ return; } -int user::perform(vector &l, string &result) { +int interpreter_user::perform(vector &l, string &result) { ostringstream osm, osnm; string fullname; @@ -657,7 +657,7 @@ // saying an image has been transmitted. // constructs a string from a char * label const string uniqs=myheader->label; - srv_dbgprintf("Ok so far. Asking the GUI to please diplay img %s\n", myheader->label); + srv_dbgprintf("Ok so far. Asking the GUI to please display img %s\n", myheader->label); IOBlackBox->pleaseDisplay(uniqs); // note: we can't call the GUI directly as we are within // the server's thread. @@ -926,7 +926,7 @@ int close_image::perform(vector &l, string &result) { if (mainViewer) { if (l.size() == 0) { - close_cb(0,0); // close the currently diplayed image + close_cb(0,0); // close the currently displayed image return 0; } else if (cmp_nocase(l[0], OVERLAY_MARKER) == 0) { closeoverlay_cb(0,0); @@ -1238,7 +1238,7 @@ mainViewer->setdisplaymode(static_cast(maybenextmode)); break; default: - dbgprintf("Diplay mode given (%d) is incorrect\n", maybenextmode); + dbgprintf("Display mode given (%d) is incorrect\n", maybenextmode); break; // don't change the display mode } mainMenuBar->redraw(); @@ -1439,7 +1439,7 @@ tokens["help"] = new interpreter_help; tokens["?"] = new interpreter_help; tokens["pf"] = new print_pointfile; - tokens["user"] = new user; + tokens["user"] = new interpreter_user; tokens["deny"] = new deny; tokens["put"] = new put; tokens["putm"] = new putm; --- a/server/imserver.cxx +++ b/server/imserver.cxx @@ -230,7 +230,7 @@ for (p = lc.begin(); p != lc.end() ; p++) { if (!(*p)->result_isempty()) { // send the result through the socket - srv_dbgprintf("sending result throught the socket\n"); + srv_dbgprintf("sending result through the socket\n"); (*p)->sendResult(); } } --- a/io/readps.cxx +++ b/io/readps.cxx @@ -209,7 +209,7 @@ dbgprintf("going back to beginning and shifting the origin\n"); TmpFile.seekp(0, ios_base::beg); TmpFile << os_translate.str() << endl; - dbgprintf("Writing %s at the begining\n", os_translate.str().c_str()); + dbgprintf("Writing %s at the beginning\n", os_translate.str().c_str()); } } --- a/io/readpnm.cxx +++ b/io/readpnm.cxx @@ -333,7 +333,7 @@ if ((*pixtype == IM_BINARY) || (*pixtype == IM_UINT1)) { // get all the data - buffp[0] = malloc(ncol*nrow*sizeof(unsigned char)); + buffp[0] = malloc((long)ncol*(long)nrow*sizeof(unsigned char)); cp = (unsigned char *)(buffp[0]); for (j = 0 ; j < ncol ; j++) { for (i = 0 ; i < nrow ; i++) { @@ -341,7 +341,7 @@ } } } else { // short - buffp[0] = malloc(ncol*nrow*sizeof(unsigned short)); + buffp[0] = malloc((long)ncol*(long)nrow*sizeof(unsigned short)); sp = (unsigned short *)(buffp[0]); for (j = 0 ; j < nrow ; j++) { for (i = 0 ; i < ncol ; i++) { @@ -448,11 +448,11 @@ if ((*pixtype == IM_BINARY) || (*pixtype == IM_UINT1)) { // get all the data - buffp[0] = malloc(ncol*nrow*nslice*sizeof(unsigned char)); + buffp[0] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned char)); cp = (unsigned char *)(buffp[0]); - numgot = fread(cp, (size_t) 1, (size_t) nrow*ncol*nslice, fp); + numgot = fread(cp, (size_t) 1, (size_t) ((long)nrow*(long)ncol*(long)nslice), fp); } else { // unsigned short - buffp[0] = malloc(ncol*nrow*nslice*sizeof(unsigned short)); + buffp[0] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned short)); sp = (unsigned short *)(buffp[0]); for (k = 0 ; k < nslice ; ++k) { for (j = 0 ; j < nrow ; j++) { @@ -538,7 +538,7 @@ buffp = (void **)malloc(sizeof(void *)); // get all the data - buffp[0] = malloc(ncol*nrow*nslice*sizeof(unsigned char)); + buffp[0] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned char)); cp = (unsigned char *)(buffp[0]); for (j = 0 ; j < nrow ; j++) { for (i = 0 ; i < ncol ; i++) { @@ -586,7 +586,7 @@ buffp = (void **)malloc(sizeof(void *)); // get all the data - buffp[0] = malloc(ncol * nrow * nslice * sizeof(unsigned char)); + buffp[0] = malloc((long)ncol * (long)nrow * (long)nslice * sizeof(unsigned char)); cp = (unsigned char *)(buffp[0]); for (l = 0 , k = 0 ; l < nslice ; ++l) { @@ -653,9 +653,9 @@ if ((*pixtype == IM_BINARY) || (*pixtype == IM_UINT1)) { // get all the data - buffp[0] = malloc(ncol*nrow*nslice*sizeof(unsigned char)); - buffp[1] = malloc(ncol*nrow*nslice*sizeof(unsigned char)); - buffp[2] = malloc(ncol*nrow*nslice*sizeof(unsigned char)); + buffp[0] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned char)); + buffp[1] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned char)); + buffp[2] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned char)); cpR = (unsigned char *)(buffp[0]); cpG = (unsigned char *)(buffp[1]); cpB = (unsigned char *)(buffp[2]); @@ -669,9 +669,9 @@ } } } else { // short - buffp[0] = malloc(ncol*nrow*nslice*sizeof(unsigned short)); - buffp[1] = malloc(ncol*nrow*nslice*sizeof(unsigned short)); - buffp[2] = malloc(ncol*nrow*nslice*sizeof(unsigned short)); + buffp[0] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned short)); + buffp[1] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned short)); + buffp[2] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned short)); spR = (unsigned short *)(buffp[0]); spG = (unsigned short *)(buffp[1]); spB = (unsigned short *)(buffp[2]); @@ -732,8 +732,8 @@ // one buffer buffp = (void **)malloc(sizeof(void*)); - buffp[1] = (void*) malloc(ncol*nrow*nslice*sizeof(int32_t)); - numread = fread(buffp[1], sizeof(int32_t), ncol*nrow*nslice, fp); + buffp[1] = (void*) malloc((long)ncol*(long)nrow*(long)nslice*sizeof(int32_t)); + numread = fread(buffp[1], sizeof(int32_t), (long)ncol*(long)nrow*(long)nslice, fp); if (numread < ncol*nrow*nslice) { garbage = true; retval = -1; @@ -792,9 +792,9 @@ if ((*pixtype == IM_BINARY) || (*pixtype == IM_UINT1)) { // get all the data // get all the data - buffp[0] = malloc(ncol*nrow*nslice*sizeof(unsigned char)); - buffp[1] = malloc(ncol*nrow*nslice*sizeof(unsigned char)); - buffp[2] = malloc(ncol*nrow*nslice*sizeof(unsigned char)); + buffp[0] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned char)); + buffp[1] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned char)); + buffp[2] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned char)); cpR = (unsigned char *)(buffp[0]); cpG = (unsigned char *)(buffp[1]); cpB = (unsigned char *)(buffp[2]); @@ -808,9 +808,9 @@ } } } else { // short - buffp[0] = malloc(ncol*nrow*nslice*sizeof(unsigned short)); - buffp[1] = malloc(ncol*nrow*nslice*sizeof(unsigned short)); - buffp[2] = malloc(ncol*nrow*nslice*sizeof(unsigned short)); + buffp[0] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned short)); + buffp[1] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned short)); + buffp[2] = malloc((long)ncol*(long)nrow*(long)nslice*sizeof(unsigned short)); spR = (unsigned short *)(buffp[0]); spG = (unsigned short *)(buffp[1]); spB = (unsigned short *)(buffp[2]); --- a/io/readjpeg.cxx +++ b/io/readjpeg.cxx @@ -199,11 +199,11 @@ *w = cinfo.output_width; *h = cinfo.output_height; *d = cinfo.output_components; - ibuffer = new unsigned char[(*w)*(*h)*(*d)]; + ibuffer = new unsigned char[((long)*w)*((long)*h)*((long)*d)]; rp = ibuffer; - while (rp < ibuffer + (*w)*(*h)*(*d)) { + while (rp < ibuffer + ((long)*w)*((long)*h)*((long)*d)) { jpeg_read_scanlines(&cinfo, &rp, 1); - rp += (*w)*(*d); + rp += ((long)*w)*((long)*d); } jpeg_finish_decompress(&cinfo); jpeg_destroy_decompress(&cinfo); --- a/io/readMagick.cxx +++ b/io/readMagick.cxx @@ -190,11 +190,11 @@ h = p->rows; if (myIsGrayImage(p,&exception)) { d = 1; - outbuf = (uchar *) malloc(w*h*d*sizeof(uchar)); + outbuf = (uchar *) malloc((long)w*(long)h*(long)d*sizeof(uchar)); myDispatchImage(p, 0, 0, w, h, "R", CharPixel, outbuf,&exception); } else { d = 3; - outbuf = (uchar *) malloc(w*h*d*sizeof(uchar)); + outbuf = (uchar *) malloc((long)w*(long)h*(long)d*sizeof(uchar)); myDispatchImage(p, 0, 0, w, h, "RGB", CharPixel, outbuf, &exception); } // talk to the black box --- a/io/newprefio.cxx +++ b/io/newprefio.cxx @@ -139,7 +139,7 @@ imPostscript.get("gspath", gspath_, "gs", DFLTSTRLEN-1); imPostscript.get("gvpath", gvpath_, "ghostview", DFLTSTRLEN-1); imPostscript.get("psRenderRes", psRenderRes_, 150.0); - imPostscript.get("psDiplayRes", psDisplayRes_, 75.0); + imPostscript.get("psDisplayRes", psDisplayRes_, 75.0); imPostscript.get("psRenderDepth", ival, 0); psRenderDepth_ = (psrendertype)ival; imPostscript.get("psRenderSmooth", ival, 0); @@ -182,7 +182,7 @@ imPostscript.set("gspath", gspath_); imPostscript.set("gvpath", gvpath_); imPostscript.set("psRenderRes", psRenderRes_); - imPostscript.set("psDiplayRes", psDisplayRes_); + imPostscript.set("psDisplayRes", psDisplayRes_); imPostscript.set("psRenderDepth", (int)psRenderDepth_); imPostscript.set("psRenderSmooth", (int)psRenderSmooth_); imPostscript.set("psAntialiasRender", (int)psAntialiasRender_); --- a/io/cpostscript.cxx +++ b/io/cpostscript.cxx @@ -166,7 +166,7 @@ /* case of the EPS */ if (win_type != WIN_EPS) { - myDebug("Standart ps code to eventually print on a page"); + myDebug("Standard ps code to eventually print on a page"); /* get the actual bounds of the window */ ps_getWindowBounds(paperType, win_type, orientation, &boundOx, &boundOy, &boundW, &boundH); /* startup */ @@ -895,7 +895,7 @@ /* variable */ - fprintf(tbp, "\n\n%%%% Optionnal ribbon\n"); + fprintf(tbp, "\n\n%%%% Optional ribbon\n"); fprintf(tbp, "/nbgray 256 def\n"); /* that's a constant.. */ fprintf(tbp, "/wherex %d def\n", xpos); fprintf(tbp, "/wherey %d def\n", ypos); --- a/doc/imview.1 +++ b/doc/imview.1 @@ -51,7 +51,7 @@ .TP \fB-disable_io_keys\fR This option disables some I/O shortcut that are not menu-dependent, such as c -that closes an image. This is useful in conjuction with options \fI-hide_menubar\fR and \fI-disable_menubar\fR +that closes an image. This is useful in conjunction with options \fI-hide_menubar\fR and \fI-disable_menubar\fR for limiting the user's interaction with the application. .TP \fB-disable_menubar\fR @@ -68,7 +68,7 @@ \fB-fork\fR Sends \fBimview\fR to the background (works on all platforms including windows). It is better to use this option rather than the shell semantics (adding & at the end of the command -under Unix) when the server is ran in conjuction with \fI-server\fR, +under Unix) when the server is ran in conjunction with \fI-server\fR, because imview will synchonize the foreground and background processes so that the foreground process can know the server port number. .TP @@ -100,7 +100,7 @@ .TP \fB-no_magick\fR Disables the use of the ImageMagick library. This library is very useful for reading and -writing a large number of file formats but tries to do to much sometimes, such as converting text files to +writing a large number of file formats but tries to do too much sometimes, such as converting text files to images. .TP \fB-p \fR @@ -170,7 +170,7 @@ .SS "ADVANCED USAGE" .nf - % imview aGreyLevelImage.tif -c heat.lut + % imview aGreyLevelImage.tif \-c heat.lut .fi .PP Will display image aGreyLevelImage.tif. Assuming this image only contains grey-level information @@ -179,7 +179,7 @@ .SS "SERVER USAGE" .nf - % imview -server -fork + % imview \-server \-fork Port: 7600 .fi .PP @@ -207,7 +207,7 @@ a sample client that can upload images into imview, as follows: .nf - % imclient -p 7600 /home/talbot/images/astro/jupiter.tiff + % imclient \-p 7600 /home/talbot/images/astro/jupiter.tiff .fi .SH "BUGS" .PP @@ -230,7 +230,7 @@ .SH "FILES" .PP .TP -\fB~/.imview/preferences\fR +\fB~/.fltk/hugues.talbot_csiro.au/imview.prefs\fR User preferences .TP \fB/Imview/*.lut\fR --- a/client/imclient.c +++ b/client/imclient.c @@ -1524,7 +1524,7 @@ LIARdebug("\n" "Timings: start to put : %6.4f sec\n" " put to beginning of upload : %6.4f sec\n" - " begining of upload to end : %6.4f sec\n" + " beginning of upload to end : %6.4f sec\n" " close conn to exit : %6.4f sec\n" "------------------------------------- \n" " put to close conn : %6.4f sec\n" @@ -1997,7 +1997,7 @@ " opening of socket to login : %6.4f sec\n" " login to put : %6.4f sec\n" " put to beginning of upload : %6.4f sec\n" - " begining of upload to end : %6.4f sec\n" + " beginning of upload to end : %6.4f sec\n" " end of upload to close conn : %6.4f sec\n" " close conn to exit : %6.4f sec\n" "------------------------------------- \n" debian/patches/04_fix_ics_stack_smashing.patch0000644000000000000000000004101612142242756016652 0ustar Description: fixes stack smashing in ics-reader Author: Sebastian Ramacher Sune Vuorela Bug-Debian: http://bugs.debian.org/699820 Last-Update: 2013-05-07 --- a/io/readics.cxx +++ b/io/readics.cxx @@ -80,15 +80,15 @@ res = load_ics(name, &p, &thepixtype, &nx, &ny, &nz); - pp = (void **)malloc(sizeof(void *)); - pp[0] = p; - if (res == 0) { // all went well // now reprocess that according to content // the new buffer needs to be set first before // the dimensions are changed because the previous buffer // might be freed, and we will need its dimensions. + pp = (void **)malloc(sizeof(void *)); + pp[0] = p; + IOBlackBox->setCurrBuffp(pp); IOBlackBox->setCurrImgWidth(nx); IOBlackBox->setCurrImgHeight(ny); @@ -240,14 +240,12 @@ **/ int fd, cat; - unsigned int length, n_read, ui; - char *buffer1, *buffer2, *end; - char temp1[100],temp2[100]; + unsigned int length, ui; + char *buffer1; int i; - char *t, *tg, *bp; - char delim1, delim2; + char delim1[2] = { '\0' }, delim2[2] = { '\0' }; static int kwrds = 14; - static char *keywrdtable[] = + static const char *keywrdtable[] = { "parameters", "order", @@ -264,40 +262,62 @@ "byte_order", "SCIL_TYPE" }; + /* expected categories of the keywords */ + static const int expected_category[] = { + 1, 1, 1, 1, 1, + 2, 2, 2, + 3, 3, 3, 3, + 2, 2 + }; /* make the proper filename and open the ICS file */ - strcpy(temp1,filename); - strcat(temp1,".ics"); - if ((fd = open(temp1,O_RDONLY)) < 0) return(-2); + char* path = NULL; + if (asprintf(&path, "%s.ics", filename) == -1) { + return -1; + } + + fd = open(path,O_RDONLY); + free(path); + if (fd < 0) { + return(-2); + } /* get the length of the ICS file and rewind */ length = (unsigned int)lseek(fd,0L,2); lseek(fd,0L,0); + /* the first two characters are the seperators */ + if (length < 2) + { + close(fd); + return -4; + } + /* allocate space for all data from the ICS file */ - if ((buffer1 = (char *)malloc(length)) == NULL) + if ((buffer1 = (char *)malloc(length - 1)) == NULL) { close(fd); return(-1); } - /* allocate space for the unresolved data from the ICS file */ - if ((buffer2 = (char *)malloc(length)) == NULL) + /* read delimiters */ + if (read(fd, delim1, 1) != 1 || read(fd, delim2, 1) != 1) { close(fd); free(buffer1); - return(-1); + return(-3); } + length -= 2; /* read the data into buffer1 and close the file */ - if ((n_read = read(fd,buffer1,length)) != length) + if (read(fd,buffer1,length) != length) { close(fd); free(buffer1); - free(buffer2); return(-3); } close(fd); + buffer1[length] = '\0'; /* initialisations */ icsheader->valid_filename = FALSE; @@ -315,391 +335,277 @@ icsheader->valid_compression = FALSE; icsheader->valid_byteorder = FALSE; icsheader->valid_SCIL_TYPE = FALSE; - bp = buffer1; - end = bp + length; /* EOF */ - *buffer2 = '\0'; /* initially empty */ - delim1 = *bp++; /* field delimiter */ - delim2 = *bp++; /* record delimiter */ - t = temp1; /* check if written by ICS */ - while (*bp != delim2) - *t++ = *bp++; - bp++; - *t = '\0'; - if (strncmp(temp1,"ICS",3) && strncmp(temp1,"ics",3)) + char* record_saveptr = NULL; + char* record = strtok_r(buffer1, delim2, &record_saveptr); + if (record == NULL) + { + free(buffer1); + return -4; + } + + if (strncmp(record,"ICS",3) && strncmp(record,"ics",3)) { free(buffer1); - free(buffer2); return(-4); } /* get the filename from the ICS file */ + record = strtok_r(NULL, delim2, &record_saveptr); + if (record == NULL) + { + free(buffer1); + return -4; + } - t = temp1; - while (*bp != delim2) - *t++ = *bp++; - bp++; - *t = '\0'; - - t = strchr(temp1,delim1); - strcpy(icsheader->filename,t); - *t = '\0'; - - if (strcmp(temp1,"filename")) + char* field_saveptr = NULL; + char* field = strtok_r(record, delim1, &field_saveptr); + if (strcmp(field, "filename")) { free(buffer1); - free(buffer2); return(-5); } + + field = strtok_r(NULL, delim1, &field_saveptr); + if (field == NULL) + { + free(buffer1); + return -4; + } + + strncpy(icsheader->filename, field, FILENAME_SIZE); + icsheader->filename[FILENAME_SIZE - 1] = '\0'; icsheader->valid_filename = TRUE; /* check the following records one by one and try to resolve the information per record */ - while (bp < end) /* until EOF */ + while ((record = strtok_r(NULL, delim2, &record_saveptr)) != NULL) { - /* get the next record into temp1 */ - t = temp1; - while (*bp != delim2 && bp < end) /* dont read beyond EOF */ - *t++ = *bp++; - bp++; - *t = '\0'; - - /* get the category into temp2 */ - t = temp1; - tg = temp2; - while (*t != delim1) - *tg++ = *t++; - t++; - *tg = '\0'; + field_saveptr = NULL; + /* get the category */ + field = strtok_r(record, delim1, &field_saveptr); + if (field == NULL) + { + free(buffer1); + return -4; + } /* check if it is one of the decodable categories */ cat = 0; - if (!strcmp(temp2,"layout")) cat = 1; - if (!strcmp(temp2,"representation")) cat = 2; - if (!strcmp(temp2,"parameter")) cat = 3; - + if (!strcmp(field, "layout")) cat = 1; + else if (!strcmp(field, "representation")) cat = 2; + else if (!strcmp(field, "parameter")) cat = 3; if (cat == 0) - { - /* if not concatenate record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); + /* if not, ignore it */ continue; - } + /* get the next field from this record */ - tg = temp2; - while (*t != delim1) - *tg++ = *t++; - t++; - *tg = '\0'; + field = strtok_r(NULL, delim1, &field_saveptr); + if (field == NULL) + { + free(buffer1); + return -4; + } /* find this item in the keyword table */ for (i = 0; i < kwrds; i++) - if (!strcmp(temp2,keywrdtable[i])) break; + if (!strcmp(field, keywrdtable[i])) + break; + if (i == kwrds) - { /* not found in the keyword table */ - /* concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); + /* not found in the keyword table, ignore it */ + continue; + if (cat != expected_category[i]) + /* wrong category, continue */ continue; - } + /* handle values */ + field = strtok_r(NULL, delim1, &field_saveptr); + if (field == NULL) + { + free(buffer1); + return -4; + } /* switch to the right value handling routine */ switch (i) { case 0: /* parameters */ - if (cat != 1) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } - tg = temp2; - while (*t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - icsheader->parameters = atoi(temp2); + icsheader->parameters = atoi(field); if (icsheader->parameters > MAXDIM) { /* if necessary change MAXDIM in ics.h */ free(buffer1); - free(buffer2); return(-6); } icsheader->valid_parameters = TRUE; break; case 1: /* order */ - if (cat != 1) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } if (icsheader->parameters == 0) { /* need to know the number of parameters first */ free(buffer1); - free(buffer2); return(-5); } for (i = 0; i < icsheader->parameters; i++) { - tg = temp2; - while (*t != delim1 && *t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - strcpy(icsheader->order[i],temp2); + if (field == NULL) + { + /* not enough paramaters */ + free(buffer1); + return -4; + } + strncpy(icsheader->order[i], field, ORDER_SIZE); + icsheader->order[i][ORDER_SIZE - 1] = '\0'; + field = strtok_r(NULL, delim1, &field_saveptr); } icsheader->valid_order = TRUE; break; case 2: /* sizes */ - if (cat != 1) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } if (icsheader->parameters == 0) { /* need to know the number of parameters first */ free(buffer1); - free(buffer2); return(-5); } for (i = 0; i < icsheader->parameters; i++) { - tg = temp2; - while (*t != delim1 && *t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - icsheader->sizes[i] = atoi(temp2); + if (field == NULL) { + /* not enough paramaters */ + free(buffer1); + return -4; + } + icsheader->sizes[i] = atoi(field); + field = strtok_r(NULL, delim1, &field_saveptr); } icsheader->valid_sizes = TRUE; break; case 3: /* coord */ - if (cat != 1) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } - tg = temp2; - while (*t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - strcpy(icsheader->coord,temp2); + strncpy(icsheader->coord, field, COORD_SIZE); + icsheader->coord[COORD_SIZE - 1] = '\0'; icsheader->valid_coord = TRUE; break; case 4: /* significant bits */ - if (cat != 1) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } - tg = temp2; - while (*t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - icsheader->sigbits = atoi(temp2); + icsheader->sigbits = atoi(field); icsheader->valid_sigbits = TRUE; break; case 5: /* format */ - if (cat != 2) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } - tg = temp2; - while (*t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - strcpy(icsheader->format,temp2); + strncpy(icsheader->format, field, FORMAT_SIZE); + icsheader->format[FORMAT_SIZE - 1] = '\0'; icsheader->valid_format = TRUE; break; case 6: /* signed or unsigned */ - if (cat != 2) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } - tg = temp2; - while (*t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - if (!strcmp(temp2,"unsigned")) + if (!strcmp(field, "unsigned")) icsheader->sign = UNSIGNED; - else icsheader->sign = SIGNED; + else + icsheader->sign = SIGNED; icsheader->valid_sign = TRUE; break; case 7: /* packing */ - if (cat != 2) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } - tg = temp2; - while (*t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - strcpy(icsheader->compression,temp2); + strncpy(icsheader->compression, field, CMPS_SIZE); + icsheader->compression[CMPS_SIZE - 1] = '\0'; icsheader->valid_compression = TRUE; break; case 8: /* origin */ - if (cat != 3) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } if (icsheader->parameters == 0) { /* need to know the number of parameters first */ free(buffer1); - free(buffer2); return(-5); } for (i = 0; i < icsheader->parameters; i++) { - tg = temp2; - while (*t != delim1 && *t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - icsheader->origin[i] = (float)atof(temp2); + if (field == NULL) { + /* not enough paramaters */ + free(buffer1); + return -4; + } + icsheader->origin[i] = (float)atof(field); + field = strtok_r(NULL, delim1, &field_saveptr); } icsheader->valid_origin = TRUE; break; case 9: /* scale */ - if (cat != 3) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } if (icsheader->parameters == 0) { /* need to know the number of parameters first */ free(buffer1); - free(buffer2); return(-5); } for (i = 0; i < icsheader->parameters; i++) { - tg = temp2; - while (*t != delim1 && *t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - icsheader->scale[i] = (float)atof(temp2); + if (field == NULL) { + /* not enough paramaters */ + free(buffer1); + return -4; + } + icsheader->scale[i] = (float)atof(field); + field = strtok_r(NULL, delim1, &field_saveptr); } icsheader->valid_scale = TRUE; break; case 10: /* labels */ - if (cat != 3) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } if (icsheader->parameters == 0) { /* need to know the number of parameters first */ free(buffer1); - free(buffer2); return(-5); } for (i = 0; i < icsheader->parameters; i++) { - tg = temp2; - while (*t != delim1 && *t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - strcpy(icsheader->label[i],temp2); + if (field == NULL) { + /* not enough paramaters */ + free(buffer1); + return -4; + } + strncpy(icsheader->label[i], field, LABEL_SIZE); + icsheader->label[i][LABEL_SIZE - 1] = '\0'; + field = strtok_r(NULL, delim1, &field_saveptr); } icsheader->valid_label = TRUE; break; case 11: /* units */ - if (cat != 3) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } if (icsheader->parameters == 0) { /* need to know the number of parameters first */ free(buffer1); - free(buffer2); return(-5); } for (i = 0; i < icsheader->parameters; i++) { - tg = temp2; - while (*t != delim1 && *t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - strcpy(icsheader->units[i],temp2); + if (field == NULL) { + /* not enough paramaters */ + free(buffer1); + return -4; + } + strncpy(icsheader->units[i], field, UNITS_SIZE); + icsheader->units[i][UNITS_SIZE - 1] = '\0'; + field = strtok_r(NULL, delim1, &field_saveptr); } icsheader->valid_units = TRUE; break; case 12: /* byteorder */ - if (cat != 2) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } - if (icsheader->sizes[0] == 0) - { /* need to know the number of bits first */ + if (icsheader->parameters == 0) + { /* need to know the number of parameters first */ free(buffer1); - free(buffer2); return(-5); } length = icsheader->sizes[0] / 8; for (ui = 0; ui < length; ui++) { - tg = temp2; - while (*t != delim1 && *t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - icsheader->byteorder[ui] = atoi(temp2); + if (field == NULL) { + /* not enough paramaters */ + free(buffer1); + return -4; + } + icsheader->byteorder[ui] = atoi(field); + field = strtok_r(NULL, delim1, &field_saveptr); } icsheader->valid_byteorder = TRUE; break; case 13: /* SCIL_TYPE */ - if (cat != 2) - { /* wrong category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; - } - tg = temp2; - while (*t != '\0') - *tg++ = *t++; - *tg = '\0'; - t++; - strcpy(icsheader->SCIL_TYPE,temp2); + strncpy(icsheader->SCIL_TYPE, field, SCIL_SIZE); + icsheader->SCIL_TYPE[SCIL_SIZE - 1] = '\0'; icsheader->valid_SCIL_TYPE = TRUE; break; - default: - /* unknown category concatenate this record to buffer2 */ - strcat(buffer2,temp1); - strcat(buffer2,"\n"); - break; } } /* clean up and return */ free(buffer1); - free(buffer2); return(0); } debian/control0000644000000000000000000000327212142245060010571 0ustar Source: imview Section: science Priority: optional Maintainer: Debian Science Maintainers Uploaders: Teemu Ikonen , Andreas Tille , Anton Gladky Vcs-Browser: http://git.debian.org/?p=debian-science/packages/imview.git Vcs-Git: http://git.debian.org/git/debian-science/packages/imview.git Build-Depends: debhelper (>= 9), libfltk1.1-dev, fluid (>= 1.3.0), libmagickcore-dev | libmagickwand-dev, libxpm-dev, libxft-dev, libxinerama-dev, autotools-dev, autoconf Standards-Version: 3.9.4 Homepage: http://imview.sourceforge.net/ Package: imview Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Suggests: imview-doc Description: Image viewing and analysis application Imview is an application which . * Displays a large number of image formats. * Displays 2D or 3D (as slices) images with a very good zoom and pan feature. * Works with multi-spectral, time series or multi-page documents (e.g.: Satellite images, TIFF stacks, animated GIFs and heterogeneous multi-component files). * Displays all pixel types (1-bit to 64-bit data, integer or floating point). * Arbitrary 1-D profile of 2-D images (or of 2-D slices of 3-D images) can be displayed. * Has support for arbitrary colourmaps for all pixel types (i.e.: false colour display). * Has standard image manipulation facilities (brightness/contrast, gamma, zoom, crop, rotation, etc). * Can be controlled remotely via sockets and text commands (for easy integration into various image analysis systems). * Images can be uploaded into Imview via sockets or shared memory. * And much more! debian/source/0000755000000000000000000000000012001105055010453 5ustar debian/source/format0000644000000000000000000000001412001105055011661 0ustar 3.0 (quilt) debian/source/options0000644000000000000000000000002412001105055012065 0ustar single-debian-patch debian/imview.install0000644000000000000000000000013112001105055012036 0ustar debian/imview.desktop usr/share/applications imview.xpm usr/share/pixmaps