Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Image resize filter
#1
Is there a plugin already written that would allow a user to insert a photo of any size using the WYSIWYG editor, and resize it in the editor (using HTML). Once the user clicks save, the plugin would repoint the HTML to a copy of the image that had been resized to the size specified in the HTML.

Much like this: http://drupal.org/project/image_resize_filter

I am asking before I undertake a project to write this. I searched and can't seem to find anything like it.

Thanks!
Reply
#2
There's no plugin nor built-into wysiwyg editor functionality.
Only addon capable of resizing images in GS is imagizer, and core thumbnail creation functionality.
Addons: getsimple theme, Online Visitors, Notepad
Reply
#3
The attached code scans the HTML in a page and when it finds a jpeg, gif, or png image that has been resized in HTML, it creates a resized version of the image and saves it. If the image already exists, it just rewrites the HTML to point to that image.

I would appreciate some feedback. This is my first GetSimple plugin; I would rather get some review from a more experienced GetSimple dev before adding it to the plugins list.

On another note, is there any API documentation? I have been looking and searching and can't find any. The code is quite well documented, but by definition it is spread out.

Thanks!
Reply
#4
I fixed a bug and created a GitHub project.

https://github.com/will-in-wi/getsimple-...ize-filter
Reply
#5
Awesome, I haven't given it proper go yet but will definitely be making good use of it if it does the job.
Modern UI Admin for GetSimple
Watch the demo. Install this plugin. Use this CSS. Enjoy.
Reply
#6
Using a copy from your svn, downloaded yesterday, 2012/06/09, on Debian + PHP 5.3.3.

As soon as Image Resize Filter is enabled, Apache crashes with an apc-error :
Code:
Cannot redeclare simple_html_dom_node in [...]plugins/ImageResizeFilter.php on line 31.

Changing the referenced include to include_once fixed it for me, but I don't know if this is the best way to do it. Apart from that, the plugin seems to work well, in my limited testing – thanks !

EDIT to add : I have just seen a debug notice :
Code:
Notice: Constant RESIZE_CACHE_FOLDER already defined in [...]plugins/ImageResizeFilter.php on line 29
This appears where the template calls get_i18n_content() and is evident on all pages.

Just moving the current line 29 outside the function declaration seems to work.

Incidentally, do you think there should be some sort of cleaning of the resized image folder ? It doesn't take much (user) experimentation with sizes before it starts to get a bit busy. Perhaps just a manual 'Clear resized images' button somewhere ?
--
Nick.
Reply
#7
The file uploader alows thumbnail creation with a crop ui.

I wonder if this can be extended to create new images, I mean the crop code is already implemented maybe resizing can be added through a ui. And allow the saved filename to be specified, so its not just restricted to the hardcoded thumbnail.

It doesn't seem to work properly though if the thumbnail already exists i think it fails to overwrite.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#8
hameau Wrote:Using a copy from your svn, downloaded yesterday, 2012/06/09, on Debian + PHP 5.3.3.

As soon as Image Resize Filter is enabled, Apache crashes with an apc-error :
Code:
Cannot redeclare simple_html_dom_node in [...]plugins/ImageResizeFilter.php on line 31.

Changing the referenced include to include_once fixed it for me, but I don't know if this is the best way to do it. Apart from that, the plugin seems to work well, in my limited testing – thanks !

EDIT to add : I have just seen a debug notice :
Code:
Notice: Constant RESIZE_CACHE_FOLDER already defined in [...]plugins/ImageResizeFilter.php on line 29
This appears where the template calls get_i18n_content() and is evident on all pages.

Just moving the current line 29 outside the function declaration seems to work.

Thanks! Marcel did the work on this one and sent a pull request which is now merged.

Quote:Incidentally, do you think there should be some sort of cleaning of the resized image folder ? It doesn't take much (user) experimentation with sizes before it starts to get a bit busy. Perhaps just a manual 'Clear resized images' button somewhere ?

I added a clear cache button on the admin page in the plugins tab.

Thanks for the suggestions and help!
Reply




Users browsing this thread: 1 Guest(s)