Bringing the ImageUpload control to WiseJ 2.5!

0
0

Can anyone help me with this sample?

It’s supposed to resize uploaded images on the Javascript canvas before sending it to WiseJ, while preserving the aspect ratio.  The use-case is to down-size photos from cameras, that start with a huge image resolution by default, so it uploads to a remote server more quickly.  So it makes huge photos smaller before sending it to the server on a limited network connection.  I think it’s a very valid use-case for a stock control…

I can get it to compile in WiseJ 2.5 but the images are not resizing when they exceed the threshold, set in ImageSize.  It’s supposed to be calling wisej.web.ImgUpload.js but I can’t even see it being hit, nor can I set a breakpoint. I’m not sure what I’m missing (the control was originally made in WiseJ 2.1)

I’m just about ready to give up today… this would really help my demo on Wednesday.  Thank you to anyone brave enough to help…

Attachment
  • You must to post comments
0
0

Partially solved.

 

After wisej 2.1.86, starting in at least 2.1.88, the   __createUploadElement function of the Upload control changed so the “addListener” called this._onChange , and not __onUpload.

 

Pasting the 2.1.86    __createUploadElement() code into the ImageUpload.js platform file, made it so that event reverted back to the 2.1.86 state.  It is now resizing again, but we have lost any other new functionality made to the Upload control since 2.1.86

(see attached image)

Next I will see if I can compile the .dll and reference the updated ImageUpload control in my WiseJ 2.5 project.

Can we please get this feature as stock???  🙂

  • You must to post comments
0
0

So I got the source to work in version 2.1.41 using this file (attached), in .NET 4.6.  It successfully resized the images on the client.

Then I upgraded to .NET 4.8 and it still worked.

But when I tried to upgrade to WiseJ 2.5 (by right clicking Reference -> Add nuGet package -> WiseJ 2.5.38), the app ran, but didn’t resize the image.

What changes from WiseJ 2.1.41 to WiseJ 2.5.38 that would break this source? And how to get it working again?

  • Andrew Niese
    Upgrading to 2.1.42 — works. Upgrading to 2.1.60 — works. 2.1.75 works. 2.1.85 works. 2.1.86 works. 2.1.88 breaks. It seems like WiseJ 2.1.88 nuget package breaks this custom control! What happened?
  • Andrew Niese
    I can see in 2.1.87 release notes: #2396 Added (cancelable) Uploading event to Wisej.Web.Upload to receive the names of the files before starting the uploading process. Could this be the reason?
  • Andrew Niese
    my best guess is that something in this update broke the inheritance in wisej.web.ext.ImageUpload.js. I’m looking at the javascript source files but as of yet do not know how to fix it.
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.