We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Super charge the Image Sizer

Development and Programming

sambo's avatar
sambo
80 posts
17 years ago
sambo's avatar sambo

Hi,

I have an idea how to make the great Image Sizer plugin even greater. I wish I could do it myself - but I can’t 😉

What if the plugin, or another plugin in cooperation with this one could parse existing img tags and replace them with ones that come out of the plugin (after a new thumbnail has been created):

So if an entry has a tag like this:

/images/someimage.png

We could use the new plugin somehow like this:

{exp:weblog:entries.....}
{exp:superimgsizer field="{entry_width_image_tag}"}
{sized}
{/exp:superimgsizer}
{exp:weblog:entries}

The plugin would:

  • parse the {entry_width_image_tag} weblog field
  • find the img tags in it
  • iterate through them and for each one…
  • parse it into key/value pairs
  • create a new thumbnail with the width/height values from the tag (or possibly override values)
  • build a new img tag that uses the attributes from the old tag (or maybe not)
  • replace the old tag with the new one
  • spit out the entry

And we end up with the contents of the field with image tags like this:

/images/cache/someimage_350x230.png

But then the question comes. How would the plugin know if it has already done it?

I think something like this could help when there is a lot of dirty image tags in weblog entries and we want to “fix” them.

Am I maybe trying to overengineer something that can easily be done in a simple way?

Best, Sammi

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.