Design and CSS styles
Version 4.x > Design and CSS styles > Setting default height and width attribute of uploaded media file through MediaGallery webpart View modes: 
User avatar
Member
Member
mail2panki-gmail - 10/20/2009 9:02:38 AM
   
Setting default height and width attribute of uploaded media file through MediaGallery webpart
Hi All,
I want to set default height and width attribute of uploaded media file through MediaGallery webpart.Like i want to save my uploaded image file in (400*400)px format.How can i do that?


Thanks in advance

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 10/20/2009 9:37:02 AM
   
RE:Setting default height and width attribute of uploaded media file through MediaGallery webpart
Hello,

Unfortunately, this isn't possible without writing some custom code. I would recommend you to check our code of our image editor, to see, how to programmatically resize an image. It is located in the method "private void SaveImage(string name, string extension, string mimetype, byte[] binary, int width, int height)" in the file "CMSAdminControls\ImageEditor\ImageEditor.ascx.cs". You would have also to alter the MediaGalery web part.

I hope this helps.

Best regards,
Boris Pocatko