Avail feature updated
[ninja.git] / application / vendor / swiftmailer / classes / Swift / Image.php
blobc161d7a620ace19a6269f4da045b2cbdf86fb525
1 <?php
3 /*
4 * This file is part of SwiftMailer.
5 * (c) 2004-2009 Chris Corbyn
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
11 //@require 'Swift/Image.php';
12 //@require 'Swift/ByteStream/FileByteStream.php';
14 /**
15 * An image, embedded in a multipart message.
16 * @package Swift
17 * @subpackage Mime
18 * @author Chris Corbyn
20 class Swift_Image extends Swift_EmbeddedFile
23 /**
24 * Create a new EmbeddedFile.
25 * Details may be optionally provided to the constructor.
26 * @param string|Swift_OutputByteStream $data
27 * @param string $filename
28 * @param string $contentType
30 public function __construct($data = null, $filename = null,
31 $contentType = null)
33 parent::__construct($data, $filename, $contentType);
36 /**
37 * Create a new Image.
38 * @param string|Swift_OutputByteStream $data
39 * @param string $filename
40 * @param string $contentType
41 * @return Swift_Mime_EmbeddedFile
43 public static function newInstance($data = null, $filename = null,
44 $contentType = null)
46 return new self($data, $filename, $contentType);
49 /**
50 * Create a new Image from a filesystem path.
51 * @param string $path
52 * @return Swift_Mime_EmbeddedFile
54 public static function fromPath($path)
56 $image = self::newInstance()->setFile(
57 new Swift_ByteStream_FileByteStream($path)
59 return $image;