Connect with us

Scripts

anySize – Caching image resizer

[ad_1]

LIVE PREVIEWBUY FOR $6

Description

anySize is a lightweight, drop-in, fully automated, caching, make-you-coffee-and-serve-it-in-bed script that lets you request and generate images (jpg, gif or png) of any size.

For example:

You upload “image.png” to your image folder, “images”

  1. <img src=”images/image.png” />
    The image is returned at its native resolution
  2. <img src=”images/resized/image.png?s=thumb” />
    A thumbnail is presented
  3. <img src=”images/resized/image.png?s=medium” />
    A medium sized image is presented
  4. <img src=”images/resized/image.png?w=100&h=150” />
    An image with max width 150px and max height 100px is presented. Aspect ratio is maintained.
  5. <img src=”images/resized/image.png?w=100&h=150&a=false” />
    An image with width 150px and height 100px is presented. Aspect ratio is NOT maintained.

And now for the awesome:

When you request an image the first time the result is stored in a cache folder and all further requests use that cache. Image file updated and re-uploaded? No need to flush the cache; everything is automatically taken care of!      
Want to define the size of your “thumbnail” image? Want to add a “megaawesome” option so you can request images/image.png?s=megaawesome ? Want to disable arbitrary resizing (options 4 & 5)? No problem! Everything is set up in the first few lines of the code using intuitively-named variables. Works out of the box but is extremely easy to customize.

The following are flags and variables the system understands:

s: (Set Size)
Ex: <img src=”images/resized/image.png?s=someSize” />
Returns an image of a pre-determined size (as set at the top of the anySize.php file)
The default sizes out of the box are:

  • s=thumb: max size 60×60 image.
  • s=small: max size 200×200 image.
  • s=medium: max size 400×400 image.
  • s=large: max size 800×800 image.

Note: These sizes are truly simple to change, add, remove, etc. Comments in the file show how to edit these sizes.

w: (Width)
Ex: <img src=”images/resized/image.png?w=100” />
Returns an image with a width of 100px. Unless specified, aspect ratio is preserved.

h: (Height)
Ex: <img src=”images/resized/image.png?h=150” />
Returns an image with a height of 100px. Unless specified, aspect ratio is preserved.

a: (Aspect Ratio)
Ex: <img src=”images/resized/image.png?w=100&h=150&a=false” />
Returns an image with a width of 100px and a height of 150px; Aspect ratio is ignored and the image WILL be 100px wide and 150px tall if a=false

Note: If you set both w and h and do not set a to “false” the system will produce an image that fits within the box defined by w and h while maintaining the aspect ratio. Essentially w and h, when set together, form a bounding box for the result image. See Example 4 for how this might look in code.

 

But wait! There’s more!

Included in the anySize download is a speed-optimized version of the script that uses just the size flag (s) and boosts the cache speed for truly lightweight and lightening fast operation.

 

Updates!

  • August 7th 2009: Added transparency support for PNG and GIF files.

[ad_2]
Source

Download Png Image

Subscribe Our   Youtube Channel

Title

Free6 days ago

Using Virtual Reality to Engage Special Demands Students

VR is mostly a new form of entertainment that allows users to immerse themselves in an encounter like zero other....

Free6 days ago

Antivirus Software Rewards

Antivirus computer software can help give protection to your computer against phishing scams and destructive software. Older adults are particularly...

Free6 days ago

Ideal Data Room Services

Best data room providers are a combination of functionality and ease of use. Some data room providers present features such...

Free6 days ago

On the web Security Guidelines

In an progressively connected world, web based security is of critical importance for everyone, right from individuals to businesses. We...

Free6 days ago

What you need to Know About Organization Process Motorisation Software

While you’re continue to deciding whether to use organization process motorisation software, there are a few things you should know...

Free6 days ago

Which in turn Business Expansion Software is Good for Your Company?

Business production tools help your company run smoothly and scale. That they cut around all departments within your business. From...

Free6 days ago

The right way to Market an electronic Business

There are a number of ways to market a digital organization. You can use digital marketing strategies to build brand...

Free1 week ago

Malware Review — What to Look For in Antivirus Software

An anti-virus review will let you decide if the particular applications are worth the charge. This can be especially useful...

Free1 week ago

The way to select the Perfect Ant-virus Software For Your PC

If you want the very best antivirus software program for your PC, then get come to the right place. There...

Free2 weeks ago

Greatest Free Antivirus security software

If you’re looking for the best cost-free antivirus that you can purchase, then you’ve come to the right place. Presently...

Free3 weeks ago

What Board Websites Can Perform For Your Company

In this article, we are going to look at what board websites can carry out for your organization. Plank portals...

Free3 weeks ago

VPN and Anti-virus

VPN and antivirus operate tandem to be sure your online reliability. While anti virus protects your laptop or computer against...

Free3 weeks ago

Ways to Keep Your Economic Data Secure

As the earth becomes even more digital, financial support organizations will be collecting 360-degree views of customers’ activities and writing...

Free3 weeks ago

Is usually Free Malware For Business Perfect for Your Business?

A free antivirus for business method comes with a number of benefits, although it’s a bad means to fix every...

Free3 weeks ago

The best Antivirus Application

If you’re looking for the perfect anti virus software, you may have come to the right place. There are many...

Trending