Skip to content

Instantly share code, notes, and snippets.

@ks7000
Created June 13, 2016 02:58
Show Gist options
  • Save ks7000/6d5143733ec91d56d8cb391e9cbb9862 to your computer and use it in GitHub Desktop.
Save ks7000/6d5143733ec91d56d8cb391e9cbb9862 to your computer and use it in GitHub Desktop.
<?php
// ###Licencia de uso###
// Copyright 2016 Jimmy Olano at ks7000.net.ve
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// -----------------------------------------------------------
// This product includes PHP software, freely available from
// <http://www.php.net/software/>
// PHP includes the Zend Engine, freely available at
// <http://www.zend.com>
// You may obtain a copy of the License at
// <https://secure.php.net/license/3_01.txt>
// -------------------------------------------------------------
//
// #####################
// Crea instancias de las imagenes
// Obtiene el nombre de la imagen a la cual se le agregará
// el logotipo desde el argumento externo
$destino = imagecreatefromjpeg($argv[1]);
// Obtiene el nombre del logotipo en si mismo que irá en
// cada imagen procesada
$origen = imagecreatefromjpeg('CTL2016_logo.jpg');
// Copia y funde las imagenes
imagecopymerge($destino, $origen, 12, 608, 0, 0, 370, 150, 100);
// Prepara la salida a un archivo con prefijo mas el
// nombre pasado como argumento
imagejpeg($destino,'CTL2016-'.$argv[1], 80);
// Libera la memoria
imagedestroy($destino);
imagedestroy($origen);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment