[gimp] plug-ins: store PSD file version in our PSDimage data structure.
- From: Jacob Boerema <jboerema src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: store PSD file version in our PSDimage data structure.
- Date: Tue, 18 May 2021 01:52:05 +0000 (UTC)
commit 58183e55c69a2026521f8842411c3d8db755ed22
Author: Jacob Boerema <jgboerema gmail com>
Date: Sun May 16 22:51:25 2021 -0400
plug-ins: store PSD file version in our PSDimage data structure.
plug-ins/file-psd/psd-load.c | 7 +++----
plug-ins/file-psd/psd.h | 1 +
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/plug-ins/file-psd/psd-load.c b/plug-ins/file-psd/psd-load.c
index 2c5b8424d8..d31a325e5b 100644
--- a/plug-ins/file-psd/psd-load.c
+++ b/plug-ins/file-psd/psd-load.c
@@ -260,12 +260,11 @@ read_header_block (PSDimage *img_a,
GInputStream *input,
GError **error)
{
- guint16 version;
gchar sig[4];
gchar buf[6];
if (psd_read (input, sig, 4, error) < 4 ||
- psd_read (input, &version, 2, error) < 2 ||
+ psd_read (input, &img_a->version, 2, error) < 2 ||
psd_read (input, buf, 6, error) < 6 ||
psd_read (input, &img_a->channels, 2, error) < 2 ||
psd_read (input, &img_a->rows, 4, error) < 4 ||
@@ -276,7 +275,7 @@ read_header_block (PSDimage *img_a,
psd_set_error (error);
return -1;
}
- version = GUINT16_FROM_BE (version);
+ img_a->version = GUINT16_FROM_BE (img_a->version);
img_a->channels = GUINT16_FROM_BE (img_a->channels);
img_a->rows = GUINT32_FROM_BE (img_a->rows);
img_a->columns = GUINT32_FROM_BE (img_a->columns);
@@ -285,7 +284,7 @@ read_header_block (PSDimage *img_a,
IFDBG(1) g_debug ("\n\n\tSig: %.4s\n\tVer: %d\n\tChannels: "
"%d\n\tSize: %dx%d\n\tBPS: %d\n\tMode: %d\n",
- sig, version, img_a->channels,
+ sig, img_a->version, img_a->channels,
img_a->columns, img_a->rows,
img_a->bps, img_a->color_mode);
diff --git a/plug-ins/file-psd/psd.h b/plug-ins/file-psd/psd.h
index f14ae4d526..8111b2ab61 100644
--- a/plug-ins/file-psd/psd.h
+++ b/plug-ins/file-psd/psd.h
@@ -647,6 +647,7 @@ typedef struct
{
gboolean merged_image_only; /* Whether to load only the merged image data */
+ guint16 version; /* Version 1 (PSD) or 2 (PSB) */
guint16 channels; /* Number of channels: 1- 56 */
gboolean transparency; /* Image has merged transparency alpha channel */
guint32 rows; /* Number of rows: 1 - 30000 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]