Pictures.Add doesn't update Picture.PictureID property


#1

Hello,

When adding a picture to the Presentation.Pictures collection, sometimes the Picture.PictureId property never changes to show a value other than 1. I can add several images to the collection, each getting their own ID. Then I add, say, a 9th image and although the Presentation.Pictures collections has a Count=9, the PictureID of the newly added picture still says 1.

There is another post (http://www.aspose.com/Community/Forums/16257/ShowPost.aspx) where a user discusses the exact same problem at the end of his post. It doesn't look like this issue was resolved.

Can you disable the "feature" of not adding pictures to a collection that match the signature of other pictures? I'm ok with this as an option if it's what's causing the bug.

I'm using version 2.4.14.0

Thanks

Mark


#2

Probability of getting the same CRC32 for different images is very low.
I think you did something wrong. Please try these lines to add images.

int picid = pres.Pictures.Add(new Picture(pres, “image.jpg”));
Picture pic = pres.Pictures.GetPictureById(picid);

If you have problems with it please provide example of your
presentation, images and code.