Revision: 28727
          http://sourceforge.net/p/bibdesk/svn/28727
Author:   hofman
Date:     2024-02-11 17:57:26 +0000 (Sun, 11 Feb 2024)
Log Message:
-----------
get buffer parameters at start, so we can also use them to create the buffer 
with proper types

Modified Paths:
--------------
    trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm

Modified: trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm
===================================================================
--- trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm     
2024-02-11 17:43:18 UTC (rev 28726)
+++ trunk/bibdesk_vendorsrc/amaxwell/FileView/FVCGImageUtilities.mm     
2024-02-11 17:57:26 UTC (rev 28727)
@@ -800,7 +800,10 @@
      */
     vImage_Error ret = kvImageNoError;
     
-    FVImageBuffer *interleavedImageBuffer = [[FVImageBuffer alloc] 
initWithWidth:desiredSize.width height:desiredSize.height bytesPerSample:4];
+    const size_t destWidth = desiredSize.width;
+    const size_t destHeight = desiredSize.height;
+    const size_t destRowBytes = FVPaddedRowBytesForWidth(4, destWidth);
+    FVImageBuffer *interleavedImageBuffer = [[FVImageBuffer alloc] 
initWithWidth:destWidth height:destHeight rowBytes:destRowBytes];
     if (nil == interleavedImageBuffer) 
         ret = kvImageMemoryAllocationError;
         
@@ -987,9 +990,6 @@
 #endif
     }
     
-    const size_t width = interleavedBuffer->width;
-    const size_t height = interleavedBuffer->height;
-    const size_t rowBytes = interleavedBuffer->rowBytes;
     CFDataRef data = NULL;
     if (kvImageNoError == ret) {
         data = [interleavedImageBuffer copyBufferData];
@@ -1020,7 +1020,7 @@
     
     image = NULL;
     if (kvImageNoError == ret)
-        image = CGImageCreate(width, height, bitsPerComponent, bitsPerPixel, 
rowBytes, cspace, bitmapInfo, provider, NULL, true, intent);
+        image = CGImageCreate(destWidth, destHeight, bitsPerComponent, 
bitsPerPixel, destRowBytes, cspace, bitmapInfo, provider, NULL, true, intent);
     CGDataProviderRelease(provider);
     CGColorSpaceRelease(cspace);
     

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to