It is JPEG encoded data, created like this

UIImage *scaledImage = ...;
NSData *data = UIImageJPEGRepresentation(scaledImage, 1);
(the 1 is the compression quality)


I've tried using image.LoadFromFile("path.jpg") but it crashes and I can't 
figure out where. The Library is compiled into a static library so I can't see 
in which line it crashes either … any kind of help would be most appreciated, 
thanks!

On 31/08/2012, at 12:33, Leonard Rosenthol <lrose...@adobe.com> wrote:

> What is actually stored in data?  Is it raw image data or some image format 
> (like PNG or JPEG)?
>  
> From: Ismael Schellemberg [mailto:isma...@gmail.com] 
> Sent: Friday, August 31, 2012 11:22 AM
> To: podofo-users@lists.sourceforge.net
> Subject: [Podofo-users] problem drawing images
>  
> Greetings, i'm having some problems when trying to draw an image on a 
> PdfPainter object
>  
> I'm trying to create an XObject for a stamp annotation, but I must be doing 
> something wrong because the output looks buggy
> Also, the output size is about half the size of what it should be. I've tried 
> hardcoding the sizes or duplicating them but it makes no difference ...
>  
>  
> Here's the code I use, and I attached a couple images, the one I'm trying to 
> load and how it looks after I add it
>  
> Notes:
> - data is a NSData object (objective-c)
> - document is a PdfMemDocument
> - width/height are the size of the annotation / image (unsigned int)
> - I'm absolutely sure the bits per component is 8
>  
>             PdfPainter painter;
>             PdfImage image(document);
>             PdfRect rect(0, 0, width, width);
>             PdfXObject xObj(rect, document);
>             
>             
>             // copy bytes
>             const char *bytes = (const char *)data.bytes;
>             int lLen = data.length;
>             PdfMemoryInputStream stream(bytes, lLen);
>             TVecFilters filters;
>             image.SetImageData(width, height, 8, &stream, filters);
>             
>             painter.SetPage(&xObj);
>             painter.DrawImage(0.0, 0.0, &image);
>             painter.FinishPage();
>             
>             annot->SetAppearanceStream(&xObj);
>  
>  
>  
> What am I missing here??
>  
> <image001.jpg>
> <image002.png>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to