first commit of free version
This commit is contained in:
51
admin/compiler/joomla_3/wideimage/Mapper/BMP.php
Normal file
51
admin/compiler/joomla_3/wideimage/Mapper/BMP.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Gasper Kozak
|
||||
* @copyright 2007-2011
|
||||
|
||||
This file is part of WideImage.
|
||||
|
||||
WideImage is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
WideImage is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with WideImage; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
* @package Internal/Mappers
|
||||
**/
|
||||
|
||||
include_once WideImage::path() . '/vendor/de77/BMP.php';
|
||||
|
||||
/**
|
||||
* Mapper support for BMP
|
||||
*
|
||||
* @package Internal/Mappers
|
||||
*/
|
||||
class WideImage_Mapper_BMP
|
||||
{
|
||||
function load($uri)
|
||||
{
|
||||
return WideImage_vendor_de77_BMP::imagecreatefrombmp($uri);
|
||||
}
|
||||
|
||||
function loadFromString($data)
|
||||
{
|
||||
return WideImage_vendor_de77_BMP::imagecreatefromstring($data);
|
||||
}
|
||||
|
||||
function save($handle, $uri = null)
|
||||
{
|
||||
if ($uri == null)
|
||||
return WideImage_vendor_de77_BMP::imagebmp($handle);
|
||||
else
|
||||
return WideImage_vendor_de77_BMP::imagebmp($handle, $uri);
|
||||
}
|
||||
}
|
44
admin/compiler/joomla_3/wideimage/Mapper/GD.php
Normal file
44
admin/compiler/joomla_3/wideimage/Mapper/GD.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Gasper Kozak
|
||||
* @copyright 2007-2011
|
||||
|
||||
This file is part of WideImage.
|
||||
|
||||
WideImage is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
WideImage is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with WideImage; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
* @package Internal/Mappers
|
||||
**/
|
||||
|
||||
/**
|
||||
* Mapper class for GD files
|
||||
*
|
||||
* @package Internal/Mappers
|
||||
*/
|
||||
class WideImage_Mapper_GD
|
||||
{
|
||||
function load($uri)
|
||||
{
|
||||
return @imagecreatefromgd($uri);
|
||||
}
|
||||
|
||||
function save($handle, $uri = null)
|
||||
{
|
||||
if ($uri == null)
|
||||
return imagegd($handle);
|
||||
else
|
||||
return imagegd($handle, $uri);
|
||||
}
|
||||
}
|
41
admin/compiler/joomla_3/wideimage/Mapper/GD2.php
Normal file
41
admin/compiler/joomla_3/wideimage/Mapper/GD2.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Gasper Kozak
|
||||
* @copyright 2007-2011
|
||||
|
||||
This file is part of WideImage.
|
||||
|
||||
WideImage is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
WideImage is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with WideImage; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
* @package Internal/Mappers
|
||||
**/
|
||||
|
||||
/**
|
||||
* Mapper class for GD2 files
|
||||
*
|
||||
* @package Internal/Mappers
|
||||
*/
|
||||
class WideImage_Mapper_GD2
|
||||
{
|
||||
function load($uri)
|
||||
{
|
||||
return @imagecreatefromgd2($uri);
|
||||
}
|
||||
|
||||
function save($handle, $uri = null, $chunk_size = null, $type = null)
|
||||
{
|
||||
return imagegd2($handle, $uri, $chunk_size, $type);
|
||||
}
|
||||
}
|
50
admin/compiler/joomla_3/wideimage/Mapper/GIF.php
Normal file
50
admin/compiler/joomla_3/wideimage/Mapper/GIF.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Gasper Kozak
|
||||
* @copyright 2007-2011
|
||||
|
||||
This file is part of WideImage.
|
||||
|
||||
WideImage is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
WideImage is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with WideImage; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
* @package Internal/Mappers
|
||||
**/
|
||||
|
||||
/**
|
||||
* Mapper class for GIF files
|
||||
*
|
||||
* @package Internal/Mappers
|
||||
*/
|
||||
class WideImage_Mapper_GIF
|
||||
{
|
||||
function load($uri)
|
||||
{
|
||||
return @imagecreatefromgif($uri);
|
||||
}
|
||||
|
||||
function save($handle, $uri = null)
|
||||
{
|
||||
// This is a workaround for a bug, for which PHP devs claim it's not
|
||||
// really a bug. Well, it IS.
|
||||
// You can't pass null as the second parameter, because php is
|
||||
// then trying to save an image to a '' location (which results in an
|
||||
// error, of course). And the same thing works fine for imagepng() and
|
||||
// imagejpeg(). It's a bug! ;)
|
||||
if ($uri)
|
||||
return imagegif($handle, $uri);
|
||||
else
|
||||
return imagegif($handle);
|
||||
}
|
||||
}
|
41
admin/compiler/joomla_3/wideimage/Mapper/JPEG.php
Normal file
41
admin/compiler/joomla_3/wideimage/Mapper/JPEG.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Gasper Kozak
|
||||
* @copyright 2007-2011
|
||||
|
||||
This file is part of WideImage.
|
||||
|
||||
WideImage is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
WideImage is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with WideImage; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
* @package Internal/Mappers
|
||||
**/
|
||||
|
||||
/**
|
||||
* Mapper class for JPEG files
|
||||
*
|
||||
* @package Internal/Mappers
|
||||
*/
|
||||
class WideImage_Mapper_JPEG
|
||||
{
|
||||
function load($uri)
|
||||
{
|
||||
return @imagecreatefromjpeg($uri);
|
||||
}
|
||||
|
||||
function save($handle, $uri = null, $quality = 100)
|
||||
{
|
||||
return imagejpeg($handle, $uri, $quality);
|
||||
}
|
||||
}
|
41
admin/compiler/joomla_3/wideimage/Mapper/PNG.php
Normal file
41
admin/compiler/joomla_3/wideimage/Mapper/PNG.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Gasper Kozak
|
||||
* @copyright 2007-2011
|
||||
|
||||
This file is part of WideImage.
|
||||
|
||||
WideImage is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
WideImage is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with WideImage; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
* @package Internal/Mappers
|
||||
**/
|
||||
|
||||
/**
|
||||
* Mapper class for PNG files
|
||||
*
|
||||
* @package Internal/Mappers
|
||||
*/
|
||||
class WideImage_Mapper_PNG
|
||||
{
|
||||
function load($uri)
|
||||
{
|
||||
return @imagecreatefrompng($uri);
|
||||
}
|
||||
|
||||
function save($handle, $uri = null, $compression = 9, $filters = PNG_ALL_FILTERS)
|
||||
{
|
||||
return imagepng($handle, $uri, $compression, $filters);
|
||||
}
|
||||
}
|
48
admin/compiler/joomla_3/wideimage/Mapper/TGA.php
Normal file
48
admin/compiler/joomla_3/wideimage/Mapper/TGA.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Gasper Kozak
|
||||
* @copyright 2007-2011
|
||||
|
||||
This file is part of WideImage.
|
||||
|
||||
WideImage is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation; either version 2.1 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
WideImage is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with WideImage; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
* @package Internal/Mappers
|
||||
**/
|
||||
|
||||
include_once WideImage::path() . '/vendor/de77/TGA.php';
|
||||
|
||||
/**
|
||||
* Mapper support for TGA
|
||||
*
|
||||
* @package Internal/Mappers
|
||||
*/
|
||||
class WideImage_Mapper_TGA
|
||||
{
|
||||
function load($uri)
|
||||
{
|
||||
return WideImage_vendor_de77_TGA::imagecreatefromtga($uri);
|
||||
}
|
||||
|
||||
function loadFromString($data)
|
||||
{
|
||||
return WideImage_vendor_de77_TGA::imagecreatefromstring($data);
|
||||
}
|
||||
|
||||
function save($handle, $uri = null)
|
||||
{
|
||||
throw new WideImage_Exception("Saving to TGA isn't supported.");
|
||||
}
|
||||
}
|
1
admin/compiler/joomla_3/wideimage/Mapper/index.html
Normal file
1
admin/compiler/joomla_3/wideimage/Mapper/index.html
Normal file
@ -0,0 +1 @@
|
||||
<html><body bgcolor="#FFFFFF"></body></html>
|
Reference in New Issue
Block a user