However, when an editor uploads and stores an image with DAMP, it doesn't have the predifned dimensions when rendered in the page. When I check the dimensions with Chrome Dev, it has a dimens of 227 x 344 pixels. The image that the editor uploaded had a smaller width then the prefined 262 pixels. Could this had anything to do with it?
Also on other pages, I notice that the size of the images do not conside with the predined crop dimensions.
Dang, still no luck. Just upgraded to DAMP 2.6 on the testserver, but uploaded pictures still are not cropped properly, even when I remove them and add them again.
In the screenshot, you can see that the image doesn't have the dimension 262 x 262 pixels, as defined in the Image Cropper datatype, but 214 x 320 pixels.
The images only have the proper dimensions when I scale them in Photoshop and upload them to the server.
At this moment I'm not sure whether the problem lies within DAMP or within the page layout wich is build upon Bootstrap.
If I look at the source it seems that it uses the normal media item and not a cropped image (those media names are usually different). Can you show the razor code here?
If you want an example how I use DAMP myself you can have a look at the Hybrid Framework.
Hmm that xml looks good and your code should work. Is there a node which looks different from this node? In your razor file you're looping through multiple members and I think that perhaps one of the member nodes has incorrect xml.
DAMP 2.5 not cropping images
Hi,
I'm using DAMP 2.5 with DAMP Property Converter 1.2 in my Umbraco 6.1.5 install.
I noticed that the images on the pages don't have the predefined dimensions that I set up with the Image Cropper datatype.
For instance for the memberCrop if defined a dimension of 262 x 262 pixels.
The xml that DAMP stores in umbraco.config looks like this:
However, when an editor uploads and stores an image with DAMP, it doesn't have the predifned dimensions when rendered in the page. When I check the dimensions with Chrome Dev, it has a dimens of 227 x 344 pixels. The image that the editor uploaded had a smaller width then the prefined 262 pixels. Could this had anything to do with it?
Also on other pages, I notice that the size of the images do not conside with the predined crop dimensions.
Thanks for your help,
Anthony
The Code I'm using to read out the image crop looks like this:
Hello,
I haven't seen this before. Did you try DAMP 2.6? It has some fixes which might solve it after resaving.
Jeroen
oh, I didn't know there was a DAMP 2.6 Can I install it over DAMP 2.5 or do I need to uninstall DAMP 2.5 first?
You can read the upgrade instructions on the package page: http://our.umbraco.org/projects/backoffice-extensions/digibiz-advanced-media-picker
Maybe also refresh Client Dependency.
Jeroen
ok, I successfully installed DAMP 2.6 over 2.5
just a little remark, when the installation of DAMP 2.6 was finished, I got the message:
But when I check the installed packages, the version of the installed DAMP package is 2.6 and the version history is DAMP 2.5
Good point. Forgot to update that file ;-).
Jeroen
Dang, still no luck. Just upgraded to DAMP 2.6 on the testserver, but uploaded pictures still are not cropped properly, even when I remove them and add them again.
In the screenshot, you can see that the image doesn't have the dimension 262 x 262 pixels, as defined in the Image Cropper datatype, but 214 x 320 pixels.
The images only have the proper dimensions when I scale them in Photoshop and upload them to the server.
At this moment I'm not sure whether the problem lies within DAMP or within the page layout wich is build upon Bootstrap.
You can view the page here: http://testcjs.ugent.be/members.aspx
If I look at the source it seems that it uses the normal media item and not a cropped image (those media names are usually different). Can you show the razor code here?
If you want an example how I use DAMP myself you can have a look at the Hybrid Framework.
Jeroen
Hi Jeroen,
This is my Razor Source Code:
@{ var members = Model.Content.Children;
}
Thanks for looking into it.
Anthony
I'm looking at your code, but you don't use the cropper anywhere.
Try this for the image:
Jeroen
Hi Jeroen,
I tried the above code but then I get a KeyNotFoundException:
Hmm try debugging the code and see what's in the image.First.TypedCrops dictionary.
Jeroen
I debugged the code, the odd thing is, that the line:
never gets executed. The code breaks at the above line:
I checked the content of the memberImage property while debugging. It contains this:
Do all your nodes have the memberImage property? Maybe it's better to post the xml of the entire node here.
Jeroen
you mean the full xml of a MemberItem node?
Is it normal that the fullMedia attribute is an empty string?
Hmm that xml looks good and your code should work. Is there a node which looks different from this node? In your razor file you're looping through multiple members and I think that perhaps one of the member nodes has incorrect xml.
Jeroen
Hi Jeroen,
I don't think this is the case, as I have not only the problem with the memberImage property, but with all properties of type DAMP.
Also the code breaks on a valid DAMP node.
greetings,
Anthony
Sorry I don't know what could be the problem. I've never had any issues so you probably did something wrong.
Maybe have a better look at the DAMP Gallery and Hybrid Framework to see how it's done there.
Jeroen
yes, I checked out the Hybrid Framework project. Can I copy the GetCroppedImage extension method to my Umbraco 6.1.5 project?
found the issue,
Got my script working by making the memberImage property dynamic and using the Crops dynamic library:
@{ var members = Model.Content.Children;
}
Hmm strange that it works when everything is dynamic. I'm not using dynamic because strongly typed can be faster.
Jeroen
Maybe it has something to do with the namespaces I'm inheriting. My script is in a Partial View Macro File:
the odd thing is, that when I debug my object of type DAMP.PropertyEditorValueConverter.Model the TypedCrops property is there, with 1 item in it:
But when I try to access it via
I'm getting the KeyNotFoundException error
I think I know the problem :-). TypedCrops lowers the key name. So it's not publicationCrop, but publicationcrop
Try this:
Jeroen
and we have a winner :)) It's working.
Thanks a lot Jeroen
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.