applied patch from Eric Ross that changes the PSD save plug-in to save an
2007-06-16 Sven Neumann <sven@gimp.org> * plug-ins/common/psd-save.c: applied patch from Eric Ross that changes the PSD save plug-in to save an extra data block with the layer names in UCS-2 encoding (bug #447267). svn path=/trunk/; revision=22790
This commit is contained in:

committed by
Sven Neumann

parent
69510b0caf
commit
373b6bfc9f
@ -1,3 +1,9 @@
|
|||||||
|
2007-06-16 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* plug-ins/common/psd-save.c: applied patch from Eric Ross that
|
||||||
|
changes the PSD save plug-in to save an extra data block with the
|
||||||
|
layer names in UCS-2 encoding (bug #447267).
|
||||||
|
|
||||||
2007-06-15 Michael Natterer <mitch@gimp.org>
|
2007-06-15 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/actions/view-actions.c (view_actions_update): make sure all
|
* app/actions/view-actions.c (view_actions_update): make sure all
|
||||||
|
@ -157,6 +157,7 @@ static void write_string (FILE *fd, char *val, gchar *why);
|
|||||||
static void write_gchar (FILE *fd, guchar val, gchar *why);
|
static void write_gchar (FILE *fd, guchar val, gchar *why);
|
||||||
static void write_gint16 (FILE *fd, gint16 val, gchar *why);
|
static void write_gint16 (FILE *fd, gint16 val, gchar *why);
|
||||||
static void write_gint32 (FILE *fd, gint32 val, gchar *why);
|
static void write_gint32 (FILE *fd, gint32 val, gchar *why);
|
||||||
|
static void write_datablock_luni (FILE *fd, char *val, gchar *why);
|
||||||
|
|
||||||
static void write_pixel_data (FILE *fd, gint32 drawableID,
|
static void write_pixel_data (FILE *fd, gint32 drawableID,
|
||||||
glong *ChanLenPosition,
|
glong *ChanLenPosition,
|
||||||
@ -452,6 +453,47 @@ write_gint32 (FILE *fd, gint32 val, gchar *why)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void
|
||||||
|
write_datablock_luni (FILE *fd, char *val, gchar *why)
|
||||||
|
{
|
||||||
|
if (val)
|
||||||
|
{
|
||||||
|
guint32 count;
|
||||||
|
guint32 xdBlockSize;
|
||||||
|
gsize numbytes;
|
||||||
|
gchar *luniName;
|
||||||
|
|
||||||
|
luniName = g_convert_with_fallback (val, -1, "UCS-2", "UTF-8",
|
||||||
|
NULL, NULL, &numbytes, NULL);
|
||||||
|
|
||||||
|
if (luniName)
|
||||||
|
{
|
||||||
|
unsigned char len = (numbytes > 510) ? 255 : numbytes/2;
|
||||||
|
|
||||||
|
/* Only pad to even num of chars */
|
||||||
|
if( len % 2 )
|
||||||
|
xdBlockSize = len + 1;
|
||||||
|
else
|
||||||
|
xdBlockSize = len;
|
||||||
|
|
||||||
|
/* 2 bytes / char + 4 bytes for pascal num chars */
|
||||||
|
xdBlockSize = (xdBlockSize * 2) + 4;
|
||||||
|
|
||||||
|
xfwrite (fd, "8BIMluni", 8, "luni xdb signature");
|
||||||
|
write_gint32 (fd, xdBlockSize, "luni xdb size");
|
||||||
|
write_gint32 (fd, len, "luni xdb pascal string");
|
||||||
|
|
||||||
|
for (count = 0; count < len * 2; count += 2)
|
||||||
|
write_gint16 (fd, luniName[count], "luni xdb pascal string");
|
||||||
|
|
||||||
|
/* Pad to an even number of chars */
|
||||||
|
if (len % 2)
|
||||||
|
write_gint16 (fd, 0x0000, "luni xdb pascal string padding");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static gint32
|
static gint32
|
||||||
pack_pb_line (guchar *start, gint32 length, gint32 stride,
|
pack_pb_line (guchar *start, gint32 length, gint32 stride,
|
||||||
guchar *dest_ptr)
|
guchar *dest_ptr)
|
||||||
@ -1072,6 +1114,8 @@ save_layer_and_mask (FILE *fd, gint32 image_id)
|
|||||||
write_pascalstring (fd, layerName, 4, "layer name");
|
write_pascalstring (fd, layerName, 4, "layer name");
|
||||||
IFDBG printf ("\t\tLayer name: %s\n", layerName);
|
IFDBG printf ("\t\tLayer name: %s\n", layerName);
|
||||||
|
|
||||||
|
write_datablock_luni(fd, layerName, "luni extra data block");
|
||||||
|
|
||||||
/* Write real length for: Extra data */
|
/* Write real length for: Extra data */
|
||||||
|
|
||||||
eof_pos = ftell (fd);
|
eof_pos = ftell (fd);
|
||||||
|
Reference in New Issue
Block a user