Copied to clipboard

Flag this post as spam?

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


  • Robert Hessels 6 posts 26 karma points
    Aug 22, 2010 @ 19:53
    Robert Hessels
    0

    Confused image size :)

    Hi! I've been trying implementing the cropper. Everything works up to a point :)

    I've set up a special media type. When I upload an image the crop is handled nicely and the crop is beautifully saved to the file system. But strange things happen when I use TinyMCE to insert that image. Somehow the size gets confused.

    When I upload an image that doesn't need to be cropped (file dimensions are within the allowed values) everything is fine. No strange things happen when I insert the image through TinyMCE.The shown dimensions are correct.

    When I have to crop an image the confusion starts. The image is cropped to 438x254. On the file system it really is 438x254. It shows up in the image picker from TinyMCE as being 469x263. Now... that confuses me a bit...

     

    Can anyone point me in the right direction? It was nice to spend the whole sunday trying to find a solution. But now it's time to move on :)

     

    Thanks!

  • Murray Roke 452 posts 839 karma points c-trib
    Aug 23, 2010 @ 01:17
    Murray Roke
    0

    Hi Robert

    I have not used the cropper in the media section but I'm pretty sure I see what the problem is. When the image is first uploaded some auto-magic fills in the umbracoWidth and umbracoHeight fields. I imagine these are the values used by TinyMCE.

    This happens when the image is uploaded, but not when the image is cropped.

    Sorry I don't have a simple solution ready for you.

    I would have to ensure the correct values set upon Crop. (but crop does not call anything that could trigger an appropriate event in umbraco.)

    As a work-around you could set those values manually, (tell me if that fixes it) but that's not cool for a propper job :-]

  • Robert Hessels 6 posts 26 karma points
    Aug 23, 2010 @ 12:30
    Robert Hessels
    0

    Hi Murray,

     

    Thanks for your reply. I'll do some testing and will post my findings here!

Please Sign in or register to post replies

Write your reply to:

Draft