Recently Browsing 0 members
No registered users viewing this page.
(SOLVED) Strange Error Uploading Image (SQLSTATE: Warning: 1265 Data truncated for column 'ratio' at row 1)By EyeDentify
Hello dear PW gurus.
I have stumbled over a strange error that i all of sudden got when trying to upload an image to a images field on a page.
There where images allready stored in the field that i wanted to keep, but during the upload the error apear and after that all images are gone from the field and i can´t upload any, i just get the error every time.
I am running ProcessWire 3.0.153 dev.
After looking in the assets folder i find the folder for the page and the image files seems to be there including the ones i tried to upload when the error occured.
But they don´t show up in the images field in the page editor.
The error reported:
SQLSTATE: Warning: 1265 Data truncated for column 'ratio' at row 1 And here is a screenshot of the event:
The TracyDebugger Error reporting:
I hope you fine folks could point me in a direction.
But it seems our old pal set_time_limit() is back.
I can't tell what's wrong; my local development version appears just fine, but I copy over the site files and db online and the homepage content is not being contained. This is what it should look like (same site in the same browser, running on my localhost): http://imgur.com/UFZFzrd
What could be the problem here? Sorry to bring up something so irrelevant to PW here, I just know that you all are a valiant and helpful group, and no one on StackExchange seems to even know what I'm talking about.
Thanks a lot.
By Robin S
Inspired by a recent question.
Image Crop Ratios
Allows preset aspect ratios to be defined per image field for the ProcessWire image crop tool.
The module adds a select dropdown to the crop tool. Choose an aspect ratio and the crop area will be fixed to that ratio.
Install the Image Crop Ratios module.
Default aspect ratios for all image fields can be defined in the module config. Aspect ratios for specific image fields can be defined on the Input tab of the field settings. You can override the ratio settings in template context if needed. Insert a hyphen as the first item in the ratio settings unless you want to force a ratio to be applied to the crop tool. The hyphen represents a blank option that allows a free crop area to be drawn. Usage
Click the "Crop" link on the details view of an image thumbnail. Click the "Crop" icon at the top of the editor window. Choose an option from the "Ratio" select dropdown.
Bit of a newbie type question, even though I've been using PW for quite a while, I've not had to manipulate assets from the front end before. I now have a need to update image properties from the front end and I'm trying to update an image description and tags when clicking on a link. I get the selected image and for example I can delete it with the code below. But I am missing some basic understanding when updating image description field as nothing happens, no errors but the description field remains empty. Any idea what steps I am missing? Many thanks.
// how to update image description? $al = $pages->get($album); $pgfile = $al->images->getFile($file); $al->of(false); $pgfile->description = "Test description"; $al->save(); // to delete an image - this works $al->of(false); $al->images->delete($file); $al->save();