Skip to content

Instantly share code, notes, and snippets.

Xiangyu Chen cxymrzero

Block or report user

Report or block cxymrzero

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cxymrzero
cxymrzero / rename.php
Created Nov 6, 2015
将目录下所有文件替换成jpg格式
View rename.php
<?php
$dir = opendir("images");
$dirname = dirname(__FILE__) . '\images';
echo $dirname;
while(($file = readdir($dir)) !== false) {
if ($file!='.' and $file!='..') {
echo "filename: {$file}\n";
$newFilename = substr_replace($file, 'jpg', -3, 3);
rename($dirname . "\\" . $file, $dirname . "\\" . $newFilename);
}
@cxymrzero
cxymrzero / genPic.py
Last active Aug 29, 2015
将图片的四个角变成透明的脚本
View genPic.py
# coding: utf-8
# cxy @ 2014.10.28
# 将此脚本与mask.png放在同一目录下,子目录'pic_origin'存放待剪裁的图片
import os
from PIL import Image
def get_pic_list(dir_str):
lst = []
for i in os.listdir(dir_str):
You can’t perform that action at this time.