Re: [Gimp-developer] Tools vs. Plugins

2002-01-17 Thread Lourens Veen

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Thursday 17 January 2002 17:44, Dave Neary wrote:
  Please, please, please try to get this right.  When discussing GIMP, it
  is NEVER Gimp.  It is NEVER plugin.  GIMP has plug-ins.

 Surely The GIMP (or the GIMP) has plug-ins? :-)

Must be THE GIMP then. I mean what other significant GIMPs are there?

Lourens (greetings from the Dvorak-peninsula)
- -- 
GPG public key: http://home.student.utwente.nl/l.e.veen/lourens.key
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8RxfCvmNyqZHWDvURAsGuAKC5CJnd4G6rfPrSQGqEQ3ZWM7XcjACfV573
pboOM68s7JSFjYntT3ck8D8=
=MasW
-END PGP SIGNATURE-
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer



[Gimp-developer] [Fwd: Gimp PSD plugin - SEGV when opening files]

2002-01-17 Thread Adam D. Moss

Hi guys and gals,

Could someone with a good collection of .psd files please
test this against the PSD plugin to make sure it doesn't
break anything that was not broken before, and if it
checks out okay commit it to 1.2 and 1.3?  I'm afraid I
don't have the time for GIMPy stuff at the moment to test
it myself.

Cheers,
--Adam
-- 
Adam D. Moss. ,,^^[EMAIL PROTECTED]http://www.foxbox.org/   co:3

all cake everywhere has died
---BeginMessage---

Dear  Adam D. Moss (PSD plugin maintainer)

Attached is a set of context diffs for a work-around for an issue with psd.c
(PSD Plugin version 2.0.6) and PSD files generated by PanoTools. The problem
was reported by Marco Nierlich [EMAIL PROTECTED] in the
comp.graphics.apps.gimp newsgroup, and he supplied a sample of a problem image
http://home.nierlich.org/avifile/pano_psd.psd

I think that the possible problems are:
1) no layermask data
2) the resize_mask() function introduces a 1 pixel down-right shift
3) The RGBA channels arrive in an unexpected order
4) some confusion (probably on my part) about 4-layer (RGB + mask) files
   and when to add the mask layer

PS: I have not got a full copy Photoshop so I may have broken the opening of
some photoshop files without realising it. I think that having applied the fix,
some files generqated by PhotoShop 6 may get their masks incorrectly set when
loaded into Gimp. It also seems quite possible that PanoTools might be
generating invalid files - but without a full copy of Photoshop I cannot
test this.

-- 
Regards
Andy Wallis

==
Andy WallisEmail:  [EMAIL PROTECTED]
Shillito and Company   Web:  http://www.shillito.co.uk
==


*** psd.c.STD   Thu Jan 17 10:08:58 2002
--- psd.c   Thu Jan 17 10:08:55 2002
***
*** 130,135 
--- 130,141 
  
  /* *** USER DEFINES *** */
  
+ /* set to TRUE if you want Andy Wallis fixes for reading files from PanoTools, FALSE 
+otherwise.
+  * There is probably a better way of fixing the problem. Note that these fixes are 
+not tested
+  * against files from Photoshop apart from a few Photoshop 4.0 LE files and may 
+cause problems
+  * with files from more recent versions of Photoshop */
+ #define AFW_FIXES TRUE
+ 
  /* set to TRUE if you want debugging, FALSE otherwise */
  #define PSD_DEBUG FALSE
  
***
*** 1068,1073 
--- 1074,1090 
/*  throwchunk(layermaskdatasize, fd, layer mask data throw);
(*offset) += layermaskdatasize;*/
  }
+ #if AFW_FIXES
+   /* If no layermask data - set offset and size from layer data */
+   if(!layermaskdatasize) {
+ IFDBG
+   fprintf(stderr, Setting layer mask data layer\n);
+   psd_image.layer[layernum].lm_x = psd_image.layer[layernum].x;
+   psd_image.layer[layernum].lm_y = psd_image.layer[layernum].y;
+   psd_image.layer[layernum].lm_width =  psd_image.layer[layernum].width;
+   psd_image.layer[layernum].lm_height = psd_image.layer[layernum].height;
+ }
+ #endif
  
  
layerrangesdatasize = getglong(fd, layer ranges data size);
***
*** 1473,1479 
printf(NULL channel - eep!);
return NULL;
  }
- 
rtn = xmalloc(numpix * 3);
  
for (i=0; inumpix; i++)
--- 1490,1495 
***
*** 1693,1700 
--- 1709,1722 
  {
for (x=0; xdest_w; x++)
{
+ #if AFW_FIXES
+ /* Avoid a 1-pixel border top-left */
+ if ((x=src_x)  (xsrc_x+src_w) 
+ (y=src_y)  (ysrc_y+src_h))
+ #else
  if ((xsrc_x)  (xsrc_x+src_w) 
  (ysrc_y)  (ysrc_y+src_h))
+ #endif
{
  dest[dest_w * y + x] =
src[src_w * (y-src_y) + (x-src_x)];
***
*** 1726,1731 
--- 1748,1758 
gint32 iter;
fpos_t tmpfpos;
  
+ #if AFW_FIXES
+   gint32 mask_id = -1;/* ie not set */
+   int red_chan, grn_chan, blu_chan, alpha_chan, ichan;
+ #endif
+ 
IFDBG printf(--- %s -\n,name);
  
name_buf = g_strdup_printf( _(Loading %s:), name);
***
*** 1848,1853 
--- 1875,1911 
seek_to_and_unpack_pixeldata(fd, lnum, 1);
seek_to_and_unpack_pixeldata(fd, lnum, 2);
seek_to_and_unpack_pixeldata(fd, lnum, 3);
+ #if AFW_FIXES
+   /* Fix for unexpected layer data order for files from PS files 
+created by PanoTools. Rather
+* than assuming an order, we find the actual order.
+*/
+   
+   red_chan = grn_chan = blu_chan = alpha_chan = -1;
+ 
+   for(ichan=0; ichannumc; ichan++) {
+ switch(psd_image.layer[lnum].channel[ichan].type) {
+  case 0: red_chan = ichan; break;
+  case 1: grn_chan = ichan; break;
+