first commit of free version

This commit is contained in:
2016-01-30 22:28:43 +02:00
commit ecf47809f9
1834 changed files with 447351 additions and 0 deletions

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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.");
}
}

View File

@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>