Commit e147e1de authored by Mukund Sivaraman's avatar Mukund Sivaraman Committed by Mukund Sivaraman

Validated samples_per_pixel, changed the loop counter data type, and

2008-03-27  Mukund Sivaraman  <muks@mukund.org>

        * plug-ins/common/dicom.c: Validated samples_per_pixel, changed
        the loop counter data type, and patched code to work on big endian
        CPUs.


svn path=/trunk/; revision=25255
parent 2df60469
2008-03-27 Mukund Sivaraman <muks@mukund.org>
* plug-ins/common/dicom.c: Validated samples_per_pixel, changed
the loop counter data type, and patched code to work on big endian
CPUs.
2008-03-27 Sven Neumann <sven@gimp.org>
* app/gui/gui.c (gui_init): disable automatic startup notification.
......
......@@ -501,8 +501,15 @@ load_image (const gchar *filename)
if ((width > GIMP_MAX_IMAGE_SIZE) || (height > GIMP_MAX_IMAGE_SIZE))
{
g_message ("'%s' has a larger image size than GIMP can handle.",
gimp_filename_to_utf8 (filename));
g_message ("'%s' has a larger image size (%d x %d) than GIMP can handle.",
gimp_filename_to_utf8 (filename), width, height);
gimp_quit ();
}
if (samples_per_pixel > 3)
{
g_message ("'%s' has samples per pixel of %d which GIMP cannot handle.",
gimp_filename_to_utf8 (filename), samples_per_pixel);
gimp_quit ();
}
......@@ -566,7 +573,7 @@ dicom_loader (guint8 *pix_buffer,
gint height = info->height;
gint samples_per_pixel = info->samples_per_pixel;
guint16 *buf16 = (guint16 *) pix_buffer;
gint pix_idx;
gulong pix_idx;
if (info->bpp == 16)
{
......@@ -575,7 +582,7 @@ dicom_loader (guint8 *pix_buffer,
* (i.e., compensate for high_bit and bits_stored).
*/
for (pix_idx = 0; pix_idx < width * height * samples_per_pixel; pix_idx++)
buf16[pix_idx] = GUINT16_SWAP_LE_BE (buf16[pix_idx]) >>
buf16[pix_idx] = g_htons (buf16[pix_idx]) >>
((info->high_bit + 1) - info->bits_stored);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment