开发者

memory leak when JPEG, not when PNG

My application aims at saving some user photos in a PDF file in order to send the file by email. To produce a small size pdf, I want to compress my images in jpeg. When I draw jpeg to the PDF context, the pdf file is indeed much smaller 开发者_如何学JAVAthan when I use PNG, but the use of JPEG leaks.

For my debugging I added a jpeg and a png file to my project.

The following call leaks :

UIImage * destImage = [UIImage imageNamed:@"Image.JPG"];
[destImage drawInRect:drawingFrame];

whereas this one does not :

UIImage * destImage = [UIImage imageNamed:@"Image.png"];
[destImage drawInRect:drawingFrame];

Is there something I'm missing ? Is it a know issue ?

I'm thinking about a workaround that would consist in using a PNG representations of my images and set a specific compression option to the pdf I generate, but did not find this in the pdf generation sdk.

Do you have an idea about it ? Thanks in advance.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜