小编Adi*_*yev的帖子

圆形裁剪图像(php)

以下代码适用于我的笔记本电脑,但不适用于远程服务器:

<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');

$filename = "../../content/".base64_decode($_GET["file"]);


$ext = pathinfo($filename, PATHINFO_EXTENSION);

if ($ext=="jpg" || $ext=="jpeg") {
$image_s = imagecreatefromjpeg($filename);
} else if ($ext=="png") {
$image_s = imagecreatefrompng($filename);
}

$width = imagesx($image_s);
$height = imagesy($image_s);


$newwidth = 285;
$newheight = 232;

$image = imagecreatetruecolor($newwidth, $newheight);
imagealphablending($image,true);
imagecopyresampled($image,$image_s,0,0,0,0,$newwidth,$newheight,$width,$height);

// create masking
$mask = imagecreatetruecolor($width, $height);
$mask = imagecreatetruecolor($newwidth, $newheight);



$transparent = imagecolorallocate($mask, 255, 0, 0);
imagecolortransparent($mask, $transparent);



imagefilledellipse($mask, $newwidth/2, $newheight/2, $newwidth, $newheight, $transparent);



$red = imagecolorallocate($mask, 0, 0, 0);
imagecopy($image, $mask, …
Run Code Online (Sandbox Code Playgroud)

php gd

8
推荐指数
1
解决办法
1万
查看次数

什么"〜"(代字号)运算符在Java中做什么?

代码操作符在Java中是如何工作的以及它的作用是什么?

但是我在Java中编写了几年的代码,我没有使用任何使用Java的严重按位操作.当开始阅读有关按位运算符时,代字号似乎很有趣,我想分享我的小经验.

java bit-manipulation tilde

6
推荐指数
1
解决办法
9702
查看次数

带有公司签名的SSL证书的Python setuptools

我是python上的setuptools的新手。

我在install_requires列表中添加了一个包'numpy'和'tensorflow'并运行python setup.py install。由于SSL问题,它无法安装。对于基于https的网址,我们使用自签名SSL。

如果是单个软件包的点子,我可以使用--cert选项。据我所知setuptools间接使用pip。如果是这样,是否在运行setup.py时强制其使用--cert选项?

python ssl setuptools setup.py

5
推荐指数
1
解决办法
1018
查看次数

标签 统计

bit-manipulation ×1

gd ×1

java ×1

php ×1

python ×1

setup.py ×1

setuptools ×1

ssl ×1

tilde ×1