Bug reports Found a bug? Post it here please.
Version 5.x > Bug reports > resize problems View modes: 
User avatar
Member
Member
tomaszj - 5/19/2011 8:19:44 AM
   
resize problems
The code:
AttachmentManager.ResizeImageAttachment(ai, resizeToWidth, resizeToHeight, resizeToMaxSideSize);

returns oryginal data (unresized) without throws any exception when ai.AttachmentImageHeight and ai.AttachmentImageWidth are 0 in argument ai of method ResizeImageAttachment.
Properties AttachmentImageHeight and AttachmentImageWidth are 0 when object of class AttachmentInfo is created from not supported image formats.
If image format is not supported by GDIplus on server but is supported by web browser -> image is unresized on page.

User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 5/30/2011 8:58:05 AM
   
RE:resize problems
Hello,

May I know, whether you are referring to some custom attachment creation process or rather to the Kentico CMS way of attachment creation process?

If the custom code is the case, please provide us with the whole code you are using.

I tried to resize the attachment using the ResizeImageAttachment method (and calling the ai.SetObject method, of course) and it works just fine.

In case, you pointed to our pre-built functionality, please give us more details on where exactly are you creating the attachments. I mean, is it on the Form tab or rather in the Attachments section of particular document?

Moreover, what version of Kentico CMS are you using? Do you have applied any hotfix?

Thank you in advance for further details.

Best regards
Ondrej Vasil

User avatar
Member
Member
tomaszj - 5/30/2011 9:21:24 AM
   
RE:resize problems
Code in my WebPart:

UserInfo ui;
HttpPostedFile postedFile;
...

TreeProvider tree = new TreeProvider(ui);
AttachmentManager am = new AttachmentManager(tree.Connection);
Guid attachmentGuid = Guid.NewGuid();
AttachmentInfo ai = new AttachmentInfo(postedFile, galleryNode.DocumentID, attachmentGuid, tree.Connection);

/*
if (ai.AttachmentImageHeight < 1 || ai.AttachmentImageWidth < 1)
{
......... resize problem detected .......
}
*/

AttachmentManager.ResizeImageAttachment(ai, resizeToWidth, resizeToHeight, resizeToMaxSideSize);
am.SetAttachmentInfo(ai);


Kentico version: v5.5.4051 R2

I can send a sample image on your email (if necessary). This image shows a problem on Windows Server 2008 (2008 R2 is ok).


User avatar
Kentico Developer
Kentico Developer
kentico_ondrejv - 6/2/2011 6:00:37 AM
   
RE:resize problems
Hello,

Thanks for your detailed description. If you could send us that special image to suport@kentico.com or upload it somewhere so that we could download it, it would be great. We'll try to investigate further.

Best regards
Ondrej Vasil