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.
11 //@require 'Swift/Image.php';
12 //@require 'Swift/ByteStream/FileByteStream.php';
15 * An image, embedded in a multipart message.
18 * @author Chris Corbyn
20 class Swift_Image
extends Swift_EmbeddedFile
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,
33 parent
::__construct($data, $filename, $contentType);
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,
46 return new self($data, $filename, $contentType);
50 * Create a new Image from a filesystem path.
52 * @return Swift_Mime_EmbeddedFile
54 public static function fromPath($path)
56 $image = self
::newInstance()->setFile(
57 new Swift_ByteStream_FileByteStream($path)