Copied to clipboard

Flag this post as spam?

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


  • Shannon 148 posts 171 karma points
    Jan 27, 2011 @ 19:57
    Shannon
    0

    Using Image Cropper and Upload not working in 4.6.1 like 4.5.2

    I was able to upload images in the blog post and have it upload into the media section folder. That is now gone. Also I can't reference thumbmails like I use to using this code:

     

          <xsl:if test="blogImage != ''">
            <xsl:variable name="crop" select="umbraco.library:GetMedia(blogImage, 0)/crops/crops/crop [@name='NewsThumbnail']" />
              <xsl:if test="$crop/@url != ''">
                <a href="{umbraco.library:NiceUrl(@id)}"><img src="{$crop/@url}" alt="{@nodeName}" class="img"  /></a>
              </xsl:if>
            </xsl:if>

     

    Does anyone have any advice on how to reference my thumbmaills again?

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 27, 2011 @ 20:11
    Kim Andersen
    0

    Hi Shannon

    Could you try printint out the returned XMl from the GetMedia-extension. Like this:

    <textarea>
    <xsl:copy-of select="umbraco.library:GetMedia(blogImage, 0)" />
    </textarea>

    /Kim A

  • Shannon 148 posts 171 karma points
    Jan 27, 2011 @ 20:32
    Shannon
    0

    This is what I get

     

    System.OverflowException: Value was either too large or too small for an Int32.
    
    at System.Convert.ToInt32(Double value)
    at System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
    at System.Xml.Xsl.Runtime.XmlQueryRuntime.ChangeTypeXsltArgument(XmlQueryType xmlType, Object value, Type destinationType)
    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
    at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, XPathNavigator post)
    at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)
  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 27, 2011 @ 20:41
    Kim Andersen
    0

    When you try the textarea-trick? Please make sure that the property with an alias of "blogImage" has got a value. Could you make sure that's the case?

    /Kim A

  • Shannon 148 posts 171 karma points
    Jan 27, 2011 @ 22:46
    Shannon
    0

    Just wanted to go over what I've done. I went back to start everything from scratch. I edited the Image Cropper datatype to the following and gave the Property alias "umbracoFile"

    Then I edited the Image media type to include the Image Cropper:

    I also went into the Blog Post Document type and added Image Cropper and upload with the alias "umbracoFile"

    For the 5 test blog post I have, they include the same image as the uploaded blog image:

     

    When I run the following XML File http://www.pastie.org/private/ccitwk5zysfofc9ezbda I changed blogImage to umbracoFile and get the error I listed above. When I use blogImage, the XSLT file saves but nothing appears.

     

     

  • Shannon 148 posts 171 karma points
    Jan 27, 2011 @ 22:49
    Shannon
    0

    Just to add, the uploaded images do not appear in the media section but are in the media folder in Umbraco

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 28, 2011 @ 08:36
    Kim Andersen
    0

    Hi again Shannon.

    When you are using the upload data type on your Blog Post document type, I'm pretty sure that you can't use the cropper as well. You need to change the upload data type to e media picker. Then when you need an image, you go to the media section, upload your image (and crops it if you want to). Then you can go to your blog posts, and select the uploaded image.

    /Kim A

  • Shannon 148 posts 171 karma points
    Jan 28, 2011 @ 19:27
    Shannon
    0

    Figure the odds. I switch from Upload to Media Picker and everything works as normal. Thanks. I went to my backup of my 4.5.2 and saw it was Media Picker as well.

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jan 28, 2011 @ 20:08
    Kim Andersen
    0

    Well, isn't that just great :)

    I'm glad to hear that things are working again now. Could you mark one of the answers as the solution, so that this issue can be closed - thanks.

    /Kim A

Please Sign in or register to post replies

Write your reply to:

Draft