PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Wed Feb 26, 2020 12:51 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Nov 30, 2009 3:39 pm 
Offline

Joined: Mon Nov 30, 2009 3:20 pm
Posts: 1
For Images stored in an PDF with the function ReadIndexedMemoryBitmap() in PdfImage.cs were always 1 Byte per Pixel allocated independent from the bitdepth. This can potentially cause Problems (but must not). I have replaceded the sourceline
Code:
 byte[] imageData = new byte[1 * width * height];

with
Code:
byte[] imageData = new byte[(width*bits+7)/8 * height];

This should allocate the correct size and works for me.


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 30, 2009 4:48 pm 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3023
Location: Cologne, Germany
Yep, the new code is correct - I made that change a few weeks ago and it'll be corrected with version 1.31 coming out very soon now.
Anyway: thank you very much for the feedback!

It's only an allocation of temporary memory while processing the image.
It has no effect on the filesize of the PDF that is created.

I also made some changes that can lead to smaller PDF files.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group