junaidbhura / fly-dynamic-image-resizer

Fly Dynamic Image Resizer plugin for WordPress
https://wordpress.org/plugins/fly-dynamic-image-resizer/
MIT License
161 stars 26 forks source link

Image by image manual cropping option via GUI [Enhancement] #50

Closed oleole39 closed 3 years ago

oleole39 commented 3 years ago

Thank you for the work on this plugin - I am just another (actually future) user who believes it provides what Wordpress should be doing by default for the greater good. What is missing for my current usage is the ability to select manually the cropping area (image by image) within Wordpress interface. Another nice plugin called Crop-Thumbnails allows this with a very fluid user-experience - for each image of Wordpress media library and each registered sizes, it offers a GUI to crop the image with the help of the mouse.

Currently the two plugins do not work together. I haven't done extensive research so far but I assume it is due to the fact Crop-Thumbnails only retrieves image sizes registered with add_image_size() and thus has no view on the sizes registered with fly_add_image_size(). I also assume that if there was an available array of image sizes registered with fly_add_image_size(), Crop-Thumbnail could retrieve it and allow manual cropping for those size variants. As first clue for making the two projects work together I noticed that Crop-Thumbnail provides a crop_thumbnails_image_sizes filter hook.

Would Fly-dynamic-image-resizer already such array of registered image sizes?

oleole39 commented 3 years ago

Just thinking I could actually create that array with fly_get_all_image_sizes() and send it to Crop-Thumbnail (CT) via above-mentioned filter hook. I also noted CT has this other filter hook called crop_thumbnails_filename, that should allow me to save the thumbnail created with CT to .../fly-images directory with the required filename to match Fly-dynamic-image-resizer (FDIR) 's naming format.

  1. I believe such image will thus be recognised and served by FDIR as if the file had been automatically generated on first demand?
  2. Any clue on what could happen if the directory is flushed in FDIR admin menu? I guess nothing wrong on FDIR's side, but maybe broken metadata links for CT (i don't really know how Wordpress metadata system works with the database)?
junaidbhura commented 3 years ago

Hi @oleole39 thanks for creating this issue - and I'm glad you find this plugin useful!

That's an interesting feature, but unfortunately, this feature is not planned for this plugin. As such, I'm afraid I'll have to close this issue.

However, please feel free to continue this discussion here. The feature you are after sounds really custom so is way beyond my capacity to answer, sorry about that! :)