Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > nonfree-release-src > by-pkgid > 86317ec462188f155161894fac7b1c53 > files > 11

xv-3.10a-15.mga5.nonfree.src.rpm

As pointed out by long-time Friend-of-XV Rick Dyson, the XV 3.10a does an
unexpected thing if you crop an image, and then 'pad' it.  3.10a would 
effectively 'UnCrop' the image first, then pad it.  There is a workaround
(save and reload the cropped image), but that's every bit as tedious as it
sounds.

This should do the trick, with any luck.

--jhb, 7/9/98




*** xvimage.c.old	Fri Jul 10 01:18:07 1998
--- xvimage.c	Fri Jul 10 01:21:57 1998
***************
*** 2530,2536 ****
  
    rv = 1;
  
!   if ((mode != PAD_LOAD) && (wide == pWIDE && high == pHIGH && opaque==100)) {
      ErrPopUp("Padding to same size as pic while fully opaque has no effect.", 
  	     "\nI see");
      return 0;
--- 2530,2536 ----
  
    rv = 1;
  
!   if ((mode != PAD_LOAD) && (wide == cWIDE && high == cHIGH && opaque==100)) {
      ErrPopUp("Padding to same size as pic while fully opaque has no effect.", 
  	     "\nI see");
      return 0;
***************
*** 2806,2832 ****
  
    /* copy 'pic' centered onto pic24.  */
  
!   sx = (wide - pWIDE) / 2;
!   sy = (high - pHIGH) / 2;
    
!   for (py = 0; py<pHIGH; py++) {
!     ProgressMeter(0, pHIGH-1, py, "Pad");
      if ((py & 0x1f)==0) WaitCursor();
  
      p24y = sy + py;
      if (p24y >= 0 && p24y < high) {
!       for (px=0; px<pWIDE; px++) {
  	p24x = sx + px;
  	if (p24x >= 0 && p24x < wide) {
  	  p24 = pic24 + (p24y*wide  + p24x)*3;
  	  
  	  
  	  if (picType == PIC24) {                       /* src is PIC24 */
! 	    pp  = pic + (py * pWIDE + px)  *3;
  	    r = pp[0];  g = pp[1];  b = pp[2];
  	  }
  	  else {                                        /* src is PIC8 */
! 	    pp  = pic + (py*pWIDE + px);
  	    r = rMap[*pp];  g = gMap[*pp];  b = bMap[*pp];
  	  }
  	  
--- 2806,2832 ----
  
    /* copy 'pic' centered onto pic24.  */
  
!   sx = (wide - cWIDE) / 2;
!   sy = (high - cHIGH) / 2;
    
!   for (py = 0; py<cHIGH; py++) {
!     ProgressMeter(0, cHIGH-1, py, "Pad");
      if ((py & 0x1f)==0) WaitCursor();
  
      p24y = sy + py;
      if (p24y >= 0 && p24y < high) {
!       for (px=0; px<cWIDE; px++) {
  	p24x = sx + px;
  	if (p24x >= 0 && p24x < wide) {
  	  p24 = pic24 + (p24y*wide  + p24x)*3;
  	  
  	  
  	  if (picType == PIC24) {                       /* src is PIC24 */
! 	    pp  = cpic + (py * cWIDE + px)  *3;
  	    r = pp[0];  g = pp[1];  b = pp[2];
  	  }
  	  else {                                        /* src is PIC8 */
! 	    pp  = cpic + (py*cWIDE + px);
  	    r = rMap[*pp];  g = gMap[*pp];  b = bMap[*pp];
  	  }