Image won't update


On this particular page, I have an insert statement that works beautifully. That statement inserts a photo along with a bunch of other items.

On the Edit form, I have an update statement. I don’t want to overwrite any existing photo that the url for is being store in the database, so I am using a condition. The issue is actually at the image load. As soon as I add that and there is an image chosen on the upload field, nothing happens. But, it does update if no photo is chosen. The issue, at this point, is absolutely not on the crop, resize or save parts. It is - I am pretty confident with the image load. But WHAT?

Any thoughts on why this is not working? I have checked 17.4 million times and it is doing everything the image items are doing on the insert statement. Thanks!



Hi Chad,
What exactly the issue is, as these random screenshots do not really explain anything?


The issue my friend is that if you choose a file to upload - nothing happens. But if you do not choose an image to upload when updating the record, then it works.

So, I presume something in my settings is wrong or that image load doesn’t work with an update query? I don’t know what the issue is other than it isn’t working. :smiley:


Nothing in the THEN step gets executed or just the file does not get uploaded? Or does the file get uploaded but not stored in the db? Or what exactly?

Are you sure your file input name is “gallery2” and not something else?


It is gallery2.

Nothing happens as in any changes to record don’t change and the file isn’t added to database. If I don’t choose a file then the record data updates if changed.


Hold a sec. Let me pull image stuff out and see if the THEN step works with just update record, but with the condition set.


Don’t remove the steps. My question is/was:
Does the file get uploaded to the server i.e. -> is just the update step that does not get executed?

Check the debug for errors as well …


The file is going to the directory.

Here is the error returned:

{"code":0,"file":"C:\\xampp\\htdocs\\dolls\\dmxConnectLib\\lib\\image\\Processor.php","line":406,"message":"value is out of range.","trace":"#0 C:\\xampp\\htdocs\\dolls\\dmxConnectLib\\lib\\image\\Processor.php(112): lib\\image\\Processor->cy(-45, 700)\n#1 C:\\xampp\\htdocs\\dolls\\dmxConnectLib\\modules\\image.php(140): lib\\image\\Processor->crop(0, 'middle', 700, 700)\n#2 C:\\xampp\\htdocs\\dolls\\dmxConnectLib\\lib\\App.php(159): modules\\image->crop(Object(stdClass), '')\n#3 C:\\xampp\\htdocs\\dolls\\dmxConnectLib\\lib\\App.php(128): lib\\App->execSteps(Object(stdClass))\n#4 C:\\xampp\\htdocs\\dolls\\dmxConnectLib\\lib\\App.php(98): lib\\App->execSteps(Array)\n#5 C:\\xampp\\htdocs\\dolls\\dmxConnectLib\\modules\\core.php(82): lib\\App->exec(Object(stdClass), true)\n#6 C:\\xampp\\htdocs\\dolls\\dmxConnectLib\\lib\\App.php(159): modules\\core->condition(Object(stdClass), '')\n#7 C:\\xampp\\htdocs\\dolls\\dmxConnectLib\\lib\\App.php(128): lib\\App->execSteps(Object(stdClass))\n#8 C:\\xampp\\htdocs\\dolls\\dmxConnectLib\\lib\\App.php(98): lib\\App->execSteps(Array)\n#9 C:\\xampp\\htdocs\\dolls\\dmxConnectLib\\lib\\App.php(71): lib\\App->exec(Object(stdClass))\n#10 C:\\xampp\\htdocs\\dolls\\dmxConnect\\api\\database\\updatedoll.php(8): lib\\App->define(Object(stdClass))\n#11 {main}"}


Well that explains your issue … your server action errors before the update step.
You set your crop size to be bigger than the image uploaded probably.

What are you trying to achieve there exactly - upload the image, resize it, and then crop the resized image? - as looking at the screenshots your action file currently doesn’t do this.


I have resize set to this:

Crop set to this:

Okay, so you’re right about the dimensions. I should change it to upscale so smaller images are processed to.

So now with a larger image, everything is working, but it isn’t being added to the database. The actual changes in the update field are being changed in the database, but the image url isn’t being inserted. Any thoughts?


Did setting the upscale property work, the error returned is like Teodor mentioned in the crop action. The Save/Load step between Resize and Crop is not needed, but crop gives an error when image is smaller then the crop size.


I had the same problem, only with some image that were uploaded with the wrong dimensions.

To be sure, remove the crop step and it should work. After that, try the crop step, but with different values.


@patrick, Yes that works mostly. However, when the image is shorter than 700, I still get the error. But I’m not worried about that. She’ll be uploading images from her iPhone, which is much larger photos.

I removed crop and resize for now. And it is working, with the exception that it isn’t adding the url in the database. The only thing I can think of is that the column is named “gallery” and the field is “gallery2”. But I don’t think that would matter. I’ve chosen the upload -> URL for the database value. That worked on the insert statement, not sure why it isn’t working here.