BytesCo / wpsmartcrop

GNU General Public License v2.0
21 stars 13 forks source link

ACF integration #4

Open rosell-dk opened 7 years ago

rosell-dk commented 7 years ago

While it is possible to use wpsmartcrop on images in ACF (using the ordinary ACF image field), it is not very intuitive. It would be nice with a new field type for ACF based on wpsmartcrop.

PS: There is already a plugin called "ACF: Focal Point", which provides an ACF field type with the purpose of setting a focal point. That backend GUI is nice. But it is not able to switch to smaller thumbnails on smaller screens (you should perhaps include that feature in your description of the plugin, because it is awesome). Also, "ACF: Focal Point" never upscales images, but your plugin does, which is also nice.

rosell-dk commented 7 years ago

I have created a working prototype as a separate plugin. It is available here: https://github.com/rosell-dk/acf-field-wpsmartcrop

gschoppe commented 7 years ago

Wow! Thanks for all the hard work on this. You are right that I probably aught to retool the descriptions of the plug-in, as they don't do a great job of showing what it can do.

I've got some plans for the next version of the plug-in, and an ACF integration would be an excellent match for them.

I'm planning to add a few global controls (like enable smartcrop on all images), and some more granular control (enable smartcrop on the featured image on only this page, enable smartcrop on an inserted image, but only on this page, etc)

Do you mind if I use your integration as a starting point for integrating ACF support into the plugin?

rosell-dk commented 7 years ago

Go ahead :)

rosell-dk commented 6 years ago

FYI, I just made a bug-fix in https://github.com/rosell-dk/acf-field-wpsmartcrop. The field did not work properly when there where several smartcrop fields. Missed declaring three variables in input.js, line 41-43 ($horizontal, $vertical and $coordsInfo was undeclared)