Umbraco zip file bulk upload bug


There would appear to be a lot of bugs surrounding the default image upload which comes with the Runway gallery.

Problem

What happened, in my case is that the upload which initially was working fine started giving me an error of “Input string was not in correct format”. After performing some research, I still couldn’t find the solution and that’s when I had to debug Umbraco (This video explains how to do this).

Solution

This is when I found out that there was a subroutine which was being called but doesn’t actually exist. The file in question is ..\app_code\Umbraco.RunwayGallery.cs and in the “generateThumbnails” subroutine, there are two calls made to “generateThumbnail” but with different method signatures. The second one,

generateThumbnail(image, int.Parse(thumb), fileWidth, fileHeight, imageFile.FullName, imageFile.Extension.Replace(“.”, “”), fileNameThumb + “_” + thumb + “.jpg”)

in particular doesn’t have a corresponding overloaded method and would explain the error message.

Hence, I ended up commenting out some code as such:

// Generate thumbnails
string fileNameThumb = imageFile.FullName.Replace(imageFile.Extension, “_thumb”);
generateThumbnail(image, 100, fileWidth, fileHeight, imageFile.FullName, imageFile.Extension.Replace(“.”, “”), fileNameThumb + “.jpg”);
SortedList thumbnailSizesList = umbraco.cms.businesslogic.datatype.PreValues.GetPreValues(imageDocument.getProperty(“umbracoFile”).PropertyType.DataTypeDefinition.Id);
//string thumbnails = “”;
//if (thumbnailSizesList.Count > 0)
//{
//    string[] thumbnailSizes = thumbnailSizesList[0].ToString().Split(“;”.ToCharArray());
//    foreach (string thumb in thumbnailSizes)
//        if (thumb != “”)
//            generateThumbnail(image, int.Parse(thumb), fileWidth, fileHeight, imageFile.FullName, imageFile.Extension.Replace(“.”, “”), fileNameThumb + “_” + thumb + “.jpg”);
//}

and that solved my problem. There might be other unforseen problems arising from commenting out the code but from looking at this code, this section is trying to do something that’s been previously done in the same subroutine.

Advertisements
Tagged with: , , , ,
Posted in Umbraco blogs
2 comments on “Umbraco zip file bulk upload bug
  1. mac says:

    hello!

    thank you, this was exactly my problem, it worked when i first started to use the upload but after a while i got the error, but with this “fix” it works again, thank you!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: