Jump to content

Croppable Image 3


horst

Recommended Posts

See the last paragraph on the latest blog post.

https://processwire.com/blog/posts/pw-3.0.142/

Quote

One other thing I wanted to mention is that after upgrading to 3.0.142, you may see a PW warning about the Image and File Fieldtype modules failing a configurable module status check — those are expected and will only appear on one or two requests after the upgrade—you can ignore them.

Perhaps that is the issue?

Link to comment
Share on other sites

In my case, this was an true Error 500 Exception (not a simple warning with some sort of "self healing", as described by Ryan)

@matjazp your hint about modifying the module helped. The websites are back and live.

For anyone wondering which file is to change, it is this one:
/site/modules/CroppableImage3/FieldtypeCroppableImage3/FieldtypeCroppableImage3.module

Update 16 October: I saw Ryan tried to address the problem from his end today by updating the core:
https://github.com/processwire/processwire-issues/issues/995

Link to comment
Share on other sites

If allowing "debug" there is also a warning now, that does not go away:

Declaration of
ProcessWire\FieldtypeCroppableImage3::getModuleConfigInputfields(array $data)
should be compatible with
ProcessWire\FieldtypeFile::getModuleConfigInputfields(ProcessWire\InputfieldWrapper $inputfields)
in
//site/modules/CroppableImage3/FieldtypeCroppableImage3/FieldtypeCroppableImage3.module
on line 4

 
Link to comment
Share on other sites

  • 4 months later...

There is currently no support for webp with CAI3 master.

There (only) is a different branch with webp support on github. But I haven't got any feedback about it, so it shouldn't be called "production ready".

5 months ago, I locally started a complete rewrite of CAI3 to only use native core images support. But I get distracted from it. If I remember right, I have included it in one client project that is live since september. But not sure how stable it is. If you have some time for testing and you like, I send you my current version of CAI4. (?)

Edited by horst
  • Thanks 1
Link to comment
Share on other sites

- + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - 

There is a new Version in the pipe, that supports WebP too: 

- + - + - + - + - + - + - + - + - + - NEWS - 2020/03/19 - + - + - + - + - + - + - + - + - + - 

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

I upgraded an older version of PW to 3.0.x and in the process upgraded all the associated modules including CroppableImage to CroppableImage3 but somewhere along the way from moving the site from dev to live something has gone wrong because now there are problems uploading images. Sometimes they'll upload and sometimes when you click on the Choose File button, or drag an image into the field, nothing happens.

On a test page that already had an image in it, I couldn't get another one to load and there were no errors in the console. After removing the one image and resaving, neither the choose file button or dragging were working. Clicking the choose file button produced no errors, but dragging returned:

Uncaught TypeError: can't access property "grid", config.CroppableImage is undefined
/site/modules/CroppableImage/InputfieldCroppableImage/InputfieldCroppableImage.js?v=83-1429629453:405
jQuery 7
/site/modules/CroppableImage/InputfieldCroppableImage/InputfieldCroppableImage.js?v=83-1429629453:403
jQuery 11

from InputfieldCroppableImage.js:405:21

I've also just updated to 1.2.0 but the problem still remains. Any idea what I can do to fix it?

Link to comment
Share on other sites

There are different ways described in the thread how to upgrade from previous version. PW-versions and the Crop-modules! Have you followed them? 

Which was the origin PW version?

Wich Crop modules was installed and used in the origin version?

How have you updated the

  • module,
  • the user roles,
  • the image fields?

Without that information, it is hard to tell anything useful.

Link to comment
Share on other sites

PW was on v 2.5 and is now on 3.0.148 and CroppableImage was on 0.8.4 Alpha and is now on CroppableImage3 1.2.0, although initially it was upgraded to 1.1.6.

This upgrade has been a long, drawn-out process with the client going silent for long periods of time. I did the upgrade locally quite a long time ago so don't have a clear recollection of the exact process I followed. It wasn't until just recently that the problem with uploading was noticed.

I think I upgraded PW first not realising that CroppableImage wasn't compatible with PW 3.x. And then replaced the CroppableImage module folder with CroppableImage3 and then updated the fieldtype (there's only one) via the admin.

I didn't realise user roles had to be updated and I've just gone through and assigned the Crop images with CroppableImage3 role via the admin.

I've obviously made a mess of the upgrade and didn't take enough care of noting the changes I've made. But any advice you could give on how to get out of this hole I've dug for myself would be appreciated.

Link to comment
Share on other sites

I have understand right, there is only one image field in use in how many pages, ca.?

Maybe best bet would be also to create a test template with a new image field of type cai3, create a page and test things out. If this does work but the old one not, this would be good. If the new created one will not work too, this would be a greater disaster, I believe.

On a side note: file access rights for image variations are correct?

I have to leave office now for some hours, but will come back later here.

Link to comment
Share on other sites

15 minutes ago, horst said:

I have understand right, there is only one image field in use in how many pages, ca.?

There's actually two instances of the fieldtype: one on a single page with just a single image, but the bulk of the content of the site, so nearly 600 pages, are using the fieldtype with up to 12 images uploaded per page.

Quote

Maybe best bet would be also to create a test template with a new image field of type cai3, create a page and test things out. If this does work but the old one not, this would be good. If the new created one will not work too, this would be a greater disaster, I believe.

I did this, and the new field in the new template worked fine.

Quote

On a side note: file access rights for image variations are correct?

Do you mean permissions? If so, they seem to be. All 644 with same owner/group.

Link to comment
Share on other sites

  • 1 month later...

I'm trying to set maximum image files per upload with the following hook:

$wire->addHookBefore('InputfieldImage::render', function(HookEvent $event) {

 $inputfield = $event->object;
 $inputfield->setMaxFiles(20);

});

but when I go to edit a page with Images or CroppableImage3 fields I'm getting the following error:

ProcessWire: ProcessPageEdit: Method InputfieldCroppableImage3::setMaxFiles does not exist or is not callable in this context

 

Link to comment
Share on other sites

  • 2 years later...

Should Croppable Image 3 work with Image fields in Repeater Matrix

I have a regular field called Images which correctly displays my 3 Croppable Image options.

When the same Images field is added to a Repeater Matrix field, only a single Croppable Image option will display.

You can see it in effect on the attached. The image field at the top is in the repeater.

To test it further, I added a different image field to the Repeater, and again only see a single Croppable Image option.

Can anyone confirm if this is a bug?

Using 

  • Croppable Image 1.2.0
  • Processwire 3.0.200
  • Repeater Matrix 0.0.8

Thanks

 

CleanShot 2022-10-10 at 15.28.38@2x.png

Link to comment
Share on other sites

22 hours ago, Peter Knight said:

Should Croppable Image 3 work with Image fields in Repeater Matrix

I have a regular field called Images which correctly displays my 3 Croppable Image options.

When the same Images field is added to a Repeater Matrix field, only a single Croppable Image option will display.

You can see it in effect on the attached. The image field at the top is in the repeater.

To test it further, I added a different image field to the Repeater, and again only see a single Croppable Image option.

Can anyone confirm if this is a bug?

Using 

  • Croppable Image 1.2.0
  • Processwire 3.0.200
  • Repeater Matrix 0.0.8

Thanks

 

CleanShot 2022-10-10 at 15.28.38@2x.png

@horstI discovered what was happening here.

If a crop has a template name it won't appear in a repeater


staff-square,300,300,team-detail (works)
staff-square,300,300 (not working)

I don't have a fix for it other than to create a duplicate crop setting without a template name.

 

Link to comment
Share on other sites

  • 5 weeks later...
On 10/11/2022 at 3:37 PM, Peter Knight said:

I don't have a fix for it other than to create a duplicate crop setting without a template name.

Have you tried to add the same template name with repeater_** set in front? Or how exactly the repeaters template is named? If I remember right, this should work.

Example: You have a simple template called "mytemplate", and have a repeater field in it, you need to set up the CAI3 and CAI4 fields with BOTH template names. The one from the template and the one from the repeater field. (They have own, system needed, templates / templatenames)

Link to comment
Share on other sites

  • 3 months later...

Hey all, hey @horst

after trying to upgrade from version 1.1.15 to 1.2.0 I'll get following error:

Call to a member function height() on null

File: .../InputfieldCroppableImage3.module: 156

These are my crop settings for the affected field:

full,1208,755,product-item
vorschau-startseite,600,600,product-item,produkte-page
ausschnitt,960,540,feedback-item
vorschau,1200,900,news-item,section-box-1-3
boxed-third,700,450,product-item,produkte-page,repeater_rep_ImageTextBox,section-sing_person, product-item-externallink
full-wide,1280,640,produkte-page
two-third,1680,840,section-box-img-headline-link

Any ideas what might have gone wrong?

... a few moments later...

 EDIT: Seconds after posting this, I've found the error:

in crop definitions line 5 "boxed-third" there was an empty space in definition ?

I apologise for bothering you. I'll leave my dumbness here in case someone else makes the same mistake, or in case I do it again ?

Edited by DV-JF
I'm stupid :-)
  • Like 1
Link to comment
Share on other sites

  • 1 month later...

We experience a problem with Croppable3 within a RepeaterMatrix field. While the first crops are created successfully, every attempt to adjust the image will fail. There is a problem with the JQuery module. I am not sure if it's a problem with the RepeaterMatrix field way to deal with the DOM or the Croppable3 module itself.

So, the crops seem to work...

image.thumb.png.5d61b9ca92177bba9d210669b62f0c6b.png

Then when accepting it, I receive this error in the console.

image.png.b255624945863a3aec730a2bc5db5d89.png

And the new crop is not saved at all...

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...