本文整理汇总了PHP中Picture::loadPicture方法的典型用法代码示例。如果您正苦于以下问题:PHP Picture::loadPicture方法的具体用法?PHP Picture::loadPicture怎么用?PHP Picture::loadPicture使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Picture
的用法示例。
在下文中一共展示了Picture::loadPicture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ifFileDoesntExistRotate
<?php
require "smartyStarter.php";
require "Picture.php";
$pictures = new Picture($local_database, $local_username, $local_password);
$picture_id = isset($_REQUEST["picture_id"]) ? $_REQUEST["picture_id"] : "";
$rotatedPic = $pictures->loadPicture($picture_id);
$picName = $rotatedPic['filename'];
$extension = $rotatedPic['extension'];
$filepath = $rotatedPic['path'];
if (strlen($picName) < 3) {
$rotatedBy = "";
$coreName = $picName;
} else {
$rotatedBy = substr($picName, strlen($picName) - 2, 2);
if ($rotatedBy == '_a' || $rotatedBy == '_b' || $rotatedBy == '_c') {
$coreName = substr($picName, 0, strlen($picName) - 2);
} else {
$coreName = $picName;
}
}
function ifFileDoesntExistRotate($newFilepath, $filepath)
{
if (!file_exists($newFilepath)) {
$degrees = -90;
header('Content-type: image/JPG');
$source = imagecreatefromjpeg($filepath);
$rotate = imagerotate($source, $degrees, 0);
imagejpeg($rotate, $newFilepath);
//save the new image
imagedestroy($source);