[gimp/gimp-2-6] Fix the PSD structs to use signed ints for bounding box coordinates.
- From: Simon Budig <simon src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-6] Fix the PSD structs to use signed ints for bounding box coordinates.
- Date: Tue, 17 Nov 2009 00:16:38 +0000 (UTC)
commit 687ec47914ec08d6e460918cb641c196d80140a3
Author: Simon Budig <simon gimp org>
Date: Tue Nov 17 01:12:19 2009 +0100
Fix the PSD structs to use signed ints for bounding box coordinates.
(cherry picked from commit 0e440cb6d4d6ee029667363d244aff61b154c33c)
plug-ins/file-psd/psd-load.c | 32 ++++++++++++++++----------------
plug-ins/file-psd/psd.h | 24 ++++++++++++------------
2 files changed, 28 insertions(+), 28 deletions(-)
---
diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c
index d0a8455..5f43fa5 100644
--- a/plug-ins/file-psd/psd-load.c
+++ b/plug-ins/file-psd/psd-load.c
@@ -533,10 +533,10 @@ read_layer_block (PSDimage *img_a,
psd_set_error (feof (f), errno, error);
return NULL;
}
- lyr_a[lidx]->top = GUINT32_FROM_BE (lyr_a[lidx]->top);
- lyr_a[lidx]->left = GUINT32_FROM_BE (lyr_a[lidx]->left);
- lyr_a[lidx]->bottom = GUINT32_FROM_BE (lyr_a[lidx]->bottom);
- lyr_a[lidx]->right = GUINT32_FROM_BE (lyr_a[lidx]->right);
+ lyr_a[lidx]->top = GINT32_FROM_BE (lyr_a[lidx]->top);
+ lyr_a[lidx]->left = GINT32_FROM_BE (lyr_a[lidx]->left);
+ lyr_a[lidx]->bottom = GINT32_FROM_BE (lyr_a[lidx]->bottom);
+ lyr_a[lidx]->right = GINT32_FROM_BE (lyr_a[lidx]->right);
lyr_a[lidx]->num_channels = GUINT16_FROM_BE (lyr_a[lidx]->num_channels);
if (lyr_a[lidx]->num_channels > MAX_CHANNELS)
@@ -670,13 +670,13 @@ read_layer_block (PSDimage *img_a,
return NULL;
}
lyr_a[lidx]->layer_mask.top =
- GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.top);
+ GINT32_FROM_BE (lyr_a[lidx]->layer_mask.top);
lyr_a[lidx]->layer_mask.left =
- GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.left);
+ GINT32_FROM_BE (lyr_a[lidx]->layer_mask.left);
lyr_a[lidx]->layer_mask.bottom =
- GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.bottom);
+ GINT32_FROM_BE (lyr_a[lidx]->layer_mask.bottom);
lyr_a[lidx]->layer_mask.right =
- GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.right);
+ GINT32_FROM_BE (lyr_a[lidx]->layer_mask.right);
lyr_a[lidx]->layer_mask.mask_flags.relative_pos =
lyr_a[lidx]->layer_mask.flags & 1 ? TRUE : FALSE;
lyr_a[lidx]->layer_mask.mask_flags.disabled =
@@ -702,21 +702,21 @@ read_layer_block (PSDimage *img_a,
return NULL;
}
lyr_a[lidx]->layer_mask_extra.top =
- GUINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.top);
+ GINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.top);
lyr_a[lidx]->layer_mask_extra.left =
- GUINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.left);
+ GINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.left);
lyr_a[lidx]->layer_mask_extra.bottom =
- GUINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.bottom);
+ GINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.bottom);
lyr_a[lidx]->layer_mask_extra.right =
- GUINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.right);
+ GINT32_FROM_BE (lyr_a[lidx]->layer_mask_extra.right);
lyr_a[lidx]->layer_mask.top =
- GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.top);
+ GINT32_FROM_BE (lyr_a[lidx]->layer_mask.top);
lyr_a[lidx]->layer_mask.left =
- GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.left);
+ GINT32_FROM_BE (lyr_a[lidx]->layer_mask.left);
lyr_a[lidx]->layer_mask.bottom =
- GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.bottom);
+ GINT32_FROM_BE (lyr_a[lidx]->layer_mask.bottom);
lyr_a[lidx]->layer_mask.right =
- GUINT32_FROM_BE (lyr_a[lidx]->layer_mask.right);
+ GINT32_FROM_BE (lyr_a[lidx]->layer_mask.right);
lyr_a[lidx]->layer_mask.mask_flags.relative_pos =
lyr_a[lidx]->layer_mask.flags & 1 ? TRUE : FALSE;
lyr_a[lidx]->layer_mask.mask_flags.disabled =
diff --git a/plug-ins/file-psd/psd.h b/plug-ins/file-psd/psd.h
index 6292747..b0c28ff 100644
--- a/plug-ins/file-psd/psd.h
+++ b/plug-ins/file-psd/psd.h
@@ -447,10 +447,10 @@ typedef struct
/* PSD Layer mask data (length 20) */
typedef struct
{
- guint32 top; /* Layer top */
- guint32 left; /* Layer left */
- guint32 bottom; /* Layer bottom */
- guint32 right; /* Layer right */
+ gint32 top; /* Layer top */
+ gint32 left; /* Layer left */
+ gint32 bottom; /* Layer bottom */
+ gint32 right; /* Layer right */
guchar def_color; /* Default background colour */
guchar flags; /* Layer flags */
guchar extra_def_color; /* Real default background colour */
@@ -461,20 +461,20 @@ typedef struct
/* PSD Layer mask data (length 36) */
typedef struct
{
- guint32 top; /* Layer top */
- guint32 left; /* Layer left */
- guint32 bottom; /* Layer bottom */
- guint32 right; /* Layer right */
+ gint32 top; /* Layer top */
+ gint32 left; /* Layer left */
+ gint32 bottom; /* Layer bottom */
+ gint32 right; /* Layer right */
} LayerMaskExtra;
/* PSD Layer data structure */
typedef struct
{
gboolean drop; /* Do not add layer to GIMP image */
- guint32 top; /* Layer top */
- guint32 left; /* Layer left */
- guint32 bottom; /* Layer bottom */
- guint32 right; /* Layer right */
+ gint32 top; /* Layer top */
+ gint32 left; /* Layer left */
+ gint32 bottom; /* Layer bottom */
+ gint32 right; /* Layer right */
guint16 num_channels; /* Number of channels */
ChannelLengthInfo *chn_info; /* Channel length info */
gchar mode_key[4]; /* Blend mode key */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]