Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • wolulcmit 357 posts 693 karma points
    Sep 05, 2009 @ 14:46

    Resize picture to fit viewing pane if image is huge?

    One suggestion: if the uploaded image is of a rather large size (say 1000pixels by 1000pixels for example) it would be nice for the image to be scaled to a sensible/manageable size so that you don't get scrollbars... therefore allowing the crop to be executed more easily. You could set the <img width and height to be 100% and limit the size within a containing div....but maybe still calculate the containing div's aspect ratio from the original image?

  • Nik Wahlberg 639 posts 1237 karma points MVP
    Sep 05, 2009 @ 15:37
    Nik Wahlberg

    I am pretty sure that ImageGen Pro allows you to scale down if the image is larger than a certain dimension. Check it out....

  • wolulcmit 357 posts 693 karma points
    Sep 12, 2009 @ 17:28

    I was talking more specifically for the umbraco back end. Are you suggesting that I imageGen could be used together with the imagecropper datatype and the crop would still be taken from the original?
    It's really hard to demostrate this problem.... I know imageGen is a breeze for image re-sizes on the front end (website) so hadn't thought about using it on the back end as well.... will give it a try... and see what happens.

  • Warren Buckley 2106 posts 4836 karma points MVP ∞ admin hq c-trib
    Sep 12, 2009 @ 19:19
    Warren Buckley

    Tim I know the problem you are talking about. Having such a large original image simply doesnt fit into the right panel of umbraco and causes scroll bars to appear.

    I think it is a good suggestion and agree that it is a pain to work with the scrollbars when trying to make the crop.


  • Simon Dingley 1470 posts 3427 karma points c-trib
    Oct 30, 2009 @ 11:49
    Simon Dingley

    Did anyone manage to get a working solution to the large images displayed in the image cropper? Were you able to use ImageGen to resize to a manageable size for cropping?

  • Kenneth Solberg 227 posts 418 karma points
    Oct 30, 2009 @ 12:20
    Kenneth Solberg

    Thomas actually implemented support for specifying a "viewport" (jCrop feature):

    This will be part of v4.1, but I've prepared an updated dll for you here:

    (I'll update the "official" stand alone Image Cropper package with this dll on one of the coming days which includes some other adjustments as well by Casey Neehouse).

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Oct 30, 2009 @ 14:58
    Simon Dingley

    That's perfect, thanks Kenneth!

  • Murray Roke 503 posts 966 karma points c-trib
    Nov 16, 2009 @ 02:20
    Murray Roke

    Hi Kenny

    I tried replacing the DLL with the one in your zip file, but because it's for an existing project with lots of data in it already I just get exceptions on the view pages, "null reference exception", ( I guess because my viewport size is not set )  and when I try and configure the viewport size in the data type window I get a "KeyNotFoundException" (bottom).

    Suggestion 1) Tweak the DataType page to allow upgraded projects to enter values for keys that did not exist before.

    Suggestion 2) in my image cropper I calculated the viewport size from the window size, to try and fill up the screen like so, could be a nice addition?

    boxWidth: $(imageToCrop).parents(".propertyItem").width(),
    boxHeight: $(window).height(),

    Love your work :-)




    [KeyNotFoundException: The given key was not present in the dictionary.]
    System.ThrowHelper.ThrowKeyNotFoundException() +28
    System.Collections.Generic.Dictionary`2.get_Item(TKey key) +2646300
    umbraco.cms.businesslogic.datatype.controls.Factory.GetNewObject(Guid DataEditorId) +29
    umbraco.cms.businesslogic.datatype.DataTypeDefinition.get_DataType() +75
    umbraco.cms.presentation.developer.editDatatype.Page_Load(Object sender, EventArgs e) +729
    System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
    System.Web.UI.Control.OnLoad(EventArgs e) +99
    umbraco.BasePages.BasePage.OnLoad(EventArgs e) +15
    System.Web.UI.Control.LoadRecursive() +50
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Nov 16, 2009 @ 02:55
    Peter Gregory

    Hi kenny

    We also noticed that when you do use the updated DLL there is a problem with crops not being correct when the image was resized to fit the viewport.   I doesnt seem to take into account the scaling of the image to fit the viewport when working out what the crop should be. 

    The bigger the image the more pronounced the issue.

    Other than that awesome cropper.


  • Kenneth Solberg 227 posts 418 karma points
    Nov 16, 2009 @ 10:42
    Kenneth Solberg

    A crap, didn't test the patch properly obviously, sorry! I removed the updated DLLs for now.

    @Murray: I really like your way of specifying the boxWidth and boxHeight. Might change to this approach instead actually...

  • Mike 80 posts 101 karma points
    Jun 15, 2010 @ 20:05


    it seems the download link isn't working anymore? Any change this could be placed back online, I would like to test this!


  • wolulcmit 357 posts 693 karma points
    Oct 12, 2011 @ 07:33
  • Gordon Saxby 1444 posts 1855 karma points
    Dec 21, 2011 @ 16:41
    Gordon Saxby

    The issue on CodePlex says it is fixed and closed ... so how do I get the fix? I have 4.7.1 installed.


  • Tom Fulton 2030 posts 4998 karma points c-trib
    Dec 21, 2011 @ 16:58
    Tom Fulton


    I think it was added after 4.7.1 which means it should be included with the upcoming


  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Jan 17, 2012 @ 19:19
    Jeroen Breuer

    I have tested it in and it works :).


  • wolulcmit 357 posts 693 karma points
    Jan 18, 2012 @ 11:23

    Happy Days!

Please Sign in or register to post replies

Write your reply to: