Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Image Component Proposal

Proposed Component Name Zend_Image
Developer Notes http://framework.zend.com/wiki/display/ZFDEV/Zend_Image
Proposers Davey Shafik
Revision 1.0 - 12 November 2006: Initial Version. (wiki revision: 5)

Table of Contents

1. Overview

Zend_Image provides easier image manipulation using GD.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will provide an easy wrapper for common GD operations for Jpeg/Png/Gif images

4. Dependencies on Other Framework Components

  • Zend_Exception

5. Theory of Operation

Uses a factory method to return an image specific class on which to perform modifications

6. Milestones / Tasks

  • Milestone 1: Working prototype checked into the incubator
  • Milestone 2: Unit Tests & Documentation
  • Milestone 3: Release in trunk

7. Class Index

  • Zend_Image
  • Zend_Image_Png
  • Zend_Image_Jpeg
  • Zend_Image_Gif
  • Zend_Image_Exception

8. Use Cases

zone: Missing {zone-data:use-cases}

9. Class Skeletons

]]></ac:plain-text-body></ac:macro>

]]></ac:plain-text-body></ac:macro>

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Nov 14, 2006

    <p>We already had a Zend_Image proposal present. We reviewed that one last week, and decided that it did not show sufficient value over simply using GD or ImageMagick.</p>

    <p>We're trying not to make ZF components that simply wrap existing PHP classes. </p>

    <p>GD really isn't so hard to use that it requires a simpler interface.</p>

  2. Nov 28, 2006

    <ac:macro ac:name="note"><ac:parameter ac:name="title">Proposal not being considered</ac:parameter><ac:rich-text-body>

    <p>This proposal has been reviewed. The proposal describes functionality that is very similar to the existing PHP interfaces for ImageMagick or GD.</p>

    <p>We are not considering this for inclusion in the Zend Framework at this time.</p></ac:rich-text-body></ac:macro>

  3. Mar 14, 2007

    <p>I really think it should be considered.</p>

    <p>Bill, you state "We're trying not to make ZF components that simply wrap existing PHP classes.", yet we have a Zend_Json component. Contradicting yourself there. I think this proposal has it's place and while GD and ImageMagick both are easy, with this component users could do simple tasks easier and using less code on their end.</p>

    1. Mar 14, 2007

      <p>There's no contradiction. The <code>Zend_Json</code> component provides native (that is, in PHP) JSON encoding and decoding, so there is no need to add a PECL extension. This vastly simplifies the installation of open-source projects that rely on this functionality but do not want to depend on a particular PHP installation having that extension. This is also the same principle behind my <code>Zend_Mime_Magic</code> proposal. Unless this component proposes to resize and crop images natively (which would be extremely slow), it is just a wrapper.</p>

      <p>Now, that's not to say that it doesn't have some value. I am writing something very similar to this simply to abstract over GD and ImageMagick's very different APIs (which I do not agree are particularly easy to use). Some things overlap directly, while other things (namely, filters) are applied very differently. Any class that provides an abstraction layer over both would have a difficult time covering all functionality. That's why mine only focuses on the most common use cases.</p>

  4. Apr 04, 2008

    <p>I think Zend should have Zend_Image component, but not like example presented above, more like phpThumb() - with native support for gif/bmp without GD or ImageMagic, cross domain hot link protection, permissions, and more... I think this could be very usefull! I use phpThumb now, but i dont't like its coding style, and not modern architecture (but I havent seen anything better)...<br />
    Think about it!</p>

    1. Sep 24, 2008

      <p>+1, phpThumb is a great library, should be ported to Zend Framework.</p>

  5. Aug 12, 2010

    <p>Great idea. All my projects have one view helper, but have some errors.
    <a class="external-link" href="http://code.google.com/p/librerias-utiles/source/browse/trunk/librerias-utiles/app/default/views/helpers/Thumb.php">http://code.google.com/p/librerias-utiles/source/browse/trunk/librerias-utiles/app/default/views/helpers/Thumb.php</a><br />
    Here is the code. I think can help to develop this class.</p>