您的位置:首页 > 编程语言 > Python开发

使用python 3.x 对pythonchallenge-----12的解答过程

2017-09-18 16:02 423 查看
pythonchallenge-10地址:http://www.pythonchallenge.com/pc/return/evil.html图片如下:


题目解析:查看源代码,图片地址为evil1.jpg这个有点奇怪试着用evil2.jpg访问,出现一个图片,图片内容为notjpg--.gfx
于是用evil2.gfx访问链接,打开是一个乱码文件,用IE下载gfx文件
题目的意思就是将gfx文件分为5份,然后在图片中显示

解题过程:
#coding=utf-8 fromPILimportImage,ImageFile importio ImageFile.LOAD_TRUNCATED_IMAGES=True img=Image.new('RGBA',(3200,480)) path=r'./other/evil2.gfx' f=open(path,'rb').read() foriinrange(5): im=open('./other/img'+str(i)+'.jpg','wb') im.write(f[i::5]) im=Image.open('./other/img'+str(i)+'.jpg') print(im.size) img.paste(im,(i*640,0)) img.show()

答案:disproportional



                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: