How to maintain the aspect ratio of the image

Hi Team,

I am trying to add the image (picture frame). The width or height of this picture frame I am changing as per my requirement to make the picture frame of the same size as my user want.

IPictureFrame coBrand = slide.getShapes().addPictureFrame(5, 1.0F, 1.0F, image.getWidth(), image.getHeight(), image);
coBrand.getPictureFrameLock().setAspectRatioLocked(true);
coBrand.setWidth(width);

Using these lines of code, as a result, it’s not showing expected output. Only the width is changed but according to that the height not changed which resulting bad user experience can you please suggest other alternative options for this or where I am doing wrong.

@Shree995,

I have observed the issue shared by you. I like to add that whatever height and width you set for PictureFrame, the same gets applied. If you are having any issue then please share the source files and generated output reproducing the issue. We will investigate the issue further on our end on provision of requested information.

Hi @mudassir.fayyaz

I am sharing the presentation file in this the shape which having name co-brand-logo for that I want that when I set the width then relative the ratio it should set the height and when I set the height then according to that it should set the width of the picture frame.
This picture frame I am adding dynamically.
j p morgan_1.zip (485.7 KB)

Please let me know ASAP is there any solution to implement this?

@Shree995,

I have observed the presentation shared by you and unfortunately still not able to understand the issue. Can you please provide which slide has issue along with previously requested information. Please share the source image that you are adding along with generated output which is not retaining aspect ratio as per your information.

@mudassir.fayyaz
Please find the attachment in this check the layout I only added the image. Check all layout on each layout the width of the image is different but it’s showing same height. test.zip (54.5 KB)

@Shree995,

I have observed the issue shared by you and it seems to be an issue with API. An issue with ID SLIDESJAVA-38049 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

@mudassir.fayyaz
Thanks for the feedback. Can you please confirm in which version launch this issue will resolve.

@Shree995,

I like to share that the issue has just been added in our issue tracking system and is pending for investigation in issues queue. We request for your patience and will share the updates with you as soon as the issue will be fixed.

Thanks @mudassir.fayyaz

@Shree995,

You are welcome and thank you for your understanding.

The issues you have found earlier (filed as SLIDESJAVA-38049) have been fixed in this update.