I have just started working on a new site, and after a clean install of WebMatrix and Umbraco 4.7.1.1, the automatic cropping feature doesnt work when an image has been created.
I have been working with DAMP on another recent project running Umbraco 4.7.1.
I have added the two strings in web.config as shown:
I have also installed the Create Crops package, which does also not work. When I press the Create Crops button, I can see that it runs (very briefly), but it does not produce any crops.
That is strange. I've had another user who also had this problem. Not sure why actually. The image cropper has changed in 4.7.1.1, but I have a couple of sites running in 4.7.1.1 myself (upgraded from 4.7.1) and those work. Is there any error log or something?
Yes you get that razor exception because no crops are created. This is a strange bug. I don't have a lot of time to look into it now. You could download the source here and debug it if you can: http://damp.codeplex.com/SourceControl/changeset/changes/81602.
I really have no idea why this won't work. Can you download the source and debug it to see what might go wrong? The crops are created in the CallImagecropper method at the DAMP_Helper file.
I have the same problem, and after re-creating the CreateCrops dll I found the following exception:
at System.Data.SqlServerCe.SqlCeDataReader.get_HasRows() at SqlCE4Umbraco.SqlCeDataReaderHelper.get_HasRecords() at CreateCrops.CC_Helper.CallImagecropper(Int32 mediaId) in [...]\CreateCrops\CC_Helper.cs:line 58 at CreateCrops.CC_Helper.CreateCrops() in [..]\CreateCrops\CC_Helper.cs:line 36
I'm using the SqlCE database that comes with Umbraco 4.7.1 and I had a suspicion that it might have been contributing to this issue since I've had CreateCrops and DAMP run nicely in the past on other installations.
Changing CC_Helper.cs from
public static bool CallImagecropper(int mediaId) { bool result = false; IDataType newObject = new Factory().GetNewObject(new System.Guid("7A2D436C-34C2-410F-898F-4A23B3D79F54")); string commandText = string.Format("\r\n select cpd.id as id, cpt.dataTypeId as datatypeid from cmsPropertyData cpd\r\n inner join cmsPropertyType cpt on cpd.propertytypeid = cpt.Id\r\n inner join cmsDataType cdt on cpt.dataTypeId = cdt.nodeId\r\n where cpd.contentNodeId = {0}\r\n and cdt.controlId = '{1}'", mediaId, newObject.Id); using (IRecordsReader recordsReader = CC_Helper.SqlHelper.ExecuteReader(commandText, new IParameter[0])) { if (recordsReader.HasRecords) { result = true; while (recordsReader.Read()) { newObject.Data.PropertyId = recordsReader.GetInt("id"); newObject.DataTypeDefinitionId = recordsReader.GetInt("datatypeid"); CC_ImageCropper cC_ImageCropper = new CC_ImageCropper(newObject.Data, ((PrevalueEditor)newObject.PrevalueEditor).Configuration); cC_ImageCropper.Page = new Page(); cC_ImageCropper.CallInit(); cC_ImageCropper.Save(); } } } return result; }
to
public static bool CallImagecropper(int mediaId) { bool result = false; IDataType newObject = new Factory().GetNewObject(new System.Guid("7A2D436C-34C2-410F-898F-4A23B3D79F54")); string commandText = string.Format("\r\n select cpd.id as id, cpt.dataTypeId as datatypeid from cmsPropertyData cpd\r\n inner join cmsPropertyType cpt on cpd.propertytypeid = cpt.Id\r\n inner join cmsDataType cdt on cpt.dataTypeId = cdt.nodeId\r\n where cpd.contentNodeId = {0}\r\n and cdt.controlId = '{1}'", mediaId, newObject.Id); using (IRecordsReader recordsReader = CC_Helper.SqlHelper.ExecuteReader(commandText, new IParameter[0])) { while (recordsReader.Read()) { result = true; newObject.Data.PropertyId = recordsReader.GetInt("id"); newObject.DataTypeDefinitionId = recordsReader.GetInt("datatypeid"); CC_ImageCropper cC_ImageCropper = new CC_ImageCropper(newObject.Data, ((PrevalueEditor)newObject.PrevalueEditor).Configuration); cC_ImageCropper.Page = new Page(); cC_ImageCropper.CallInit(); cC_ImageCropper.Save(); } } return result; }
has fixed the problem. I'm now going to go and make the equivalent change in DAMP and re-compile that as well...
Problems with automatic crop
Hi.
I have just started working on a new site, and after a clean install of WebMatrix and Umbraco 4.7.1.1, the automatic cropping feature doesnt work when an image has been created.
I have been working with DAMP on another recent project running Umbraco 4.7.1.
I have added the two strings in web.config as shown:
I have also installed the Create Crops package, which does also not work. When I press the Create Crops button, I can see that it runs (very briefly), but it does not produce any crops.
Any clues?
Thanks in advance :)
That is strange. I've had another user who also had this problem. Not sure why actually. The image cropper has changed in 4.7.1.1, but I have a couple of sites running in 4.7.1.1 myself (upgraded from 4.7.1) and those work. Is there any error log or something?
Jeroen
Well, I have just used the Log Manager to look for any errors, but did not found any.
I also tried creating a new Umbraco 4.7.1.1 installation, with DAMP, DAMP samples, Create Crops and Custom MFU with no different result.
When navigating the sample page, I get this error when on the razor page:
Error loading MacroEngine script (file: DAMP-Razor.cshtml)
On the XSLT sample page, only the classic sample is shown (since it does not have the crop datatype attached to it).
Yes you get that razor exception because no crops are created. This is a strange bug. I don't have a lot of time to look into it now. You could download the source here and debug it if you can: http://damp.codeplex.com/SourceControl/changeset/changes/81602.
Jeroen
Hi I'm having the exact same problem on a fresh install of 4.7.1.1 including the DAMP samples.
Would be great if you get a chance to fix the bug on 4.7.1.1 as looks like an amazing package.
Many thanks,
Barney
I really have no idea why this won't work. Can you download the source and debug it to see what might go wrong? The crops are created in the CallImagecropper method at the DAMP_Helper file.
Jeroen
Hi Jeroen,
I have the same problem, and after re-creating the CreateCrops dll I found the following exception:
at System.Data.SqlServerCe.SqlCeDataReader.get_HasRows()
at SqlCE4Umbraco.SqlCeDataReaderHelper.get_HasRecords()
at CreateCrops.CC_Helper.CallImagecropper(Int32 mediaId) in [...]\CreateCrops\CC_Helper.cs:line 58
at CreateCrops.CC_Helper.CreateCrops() in [..]\CreateCrops\CC_Helper.cs:line 36
I'm using the SqlCE database that comes with Umbraco 4.7.1 and I had a suspicion that it might have been contributing to this issue since I've had CreateCrops and DAMP run nicely in the past on other installations.
Changing CC_Helper.cs from
to
has fixed the problem. I'm now going to go and make the equivalent change in DAMP and re-compile that as well...
Rob.
Hi Robert.
Nice to hear that you have found the problem! Would you please be so kind and share the recompiled files?
Thank you!
Sure!
But first a disclaimer: This is in no way an official distribution of Jeroen's work - just a patch until he releases an official fix ;)
For CreateCrops, download the dll (zipped) here: http://refactored.com.au/media/CreateCrops.zip
for the DAMP 2.0 (based on the released version), download the replacement dll here: http://refactored.com.au/media/DigibizAdvancedMediaPicker.zip
I make no warranties on the files at all :) Nor do I make any claims. Backup the existing files before replacing them first...
Enjoy ;)
Rob
I haven't tested the DAMP patch dll yet either, just so you know ;) It should work though...
Great to see you got it fixed :). Will add the code to codeplex soon. Thanks!
Jeroen
Anytime - I'll send you a bill :P
- Rob.
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.