
本地GIF图生成网页预览工具
- 类型:角色扮演
- 评分:
- 版本:v1.0 免费版
- 语言:简体中文
- 大小: 6.4M
- 更新:2022-03-17
- 本地GIF图生成网页预览工具下载
内容介绍
本地GIF图生成网页预览工具是一款非常不错的图像预览软件,能够帮助用户快速生成文件中的图片预览效果,可以一下子预览全部的动态图,使用起来非常方便有需要的用户不要错过了,赶快来下载吧!
软件介绍
电脑里有很多Gif图, 电脑的缩略图只能生成静帧的预览图,而可以通过这个生成个网页,可以一下子预览全部的动态图了. 当然,也有个弊端,一次加载大量的gif到网页上, 会特别特别占内存,就需要一个大内存.不过这都2021年了.谁还没个十几二十几大几十几的内存嘞?
开发者说明
不过您内存要是真的没多大(比如电脑4g内存,2g内存), 一定慎重加载超多图片!!!
这次的创意. 来自获取了一堆Gif后,懒着懒着突然有的灵感!...这次软件特别好写, 要是有兄台想模仿或者二次创作, 请一定要艾特我呦!!!之前我写的一些原创, 有些被人模仿去了, 然没见艾特我的就很郁闷..有艾特的我的就超开心!
软件代码
import os
import traceback
def makeweb(xpath):
filespath=""
contentfiles=[]
try:
list_dirs = os.walk(xpath)
for root, _dirs, files in list_dirs:
for f in files:
f=f.lower()
bool1 = f.endswith(".gif")
bool2 = f.endswith(".jpg")
bool3 = f.endswith(".png")
bool4 = f.endswith(".bmp")
if bool1 or bool2 or bool3 or bool4:
shortpath=root[len(xpath)+1:len(root)]
if len(shortpath)>0:
filespath=shortpath+"\\"+f
contentfiles.append(filespath)
else:
filespath=f
contentfiles.append(filespath)
if len(contentfiles)>0:
effecttype = os.path.basename(xpath)#带后缀的文件名
#effecttype="火焰"
filename = xpath+'\\'+effecttype+'.html'
with open(filename, 'w',encoding="utf-8") as file_object:
file_object.write("<!DOCTYPE html>\n")
file_object.write("<html>\n")
file_object.write("<title>"+effecttype+"</title>\n")
file_object.write("<style type=\"text/css\">.left{float: left;}.pic {/*max-width: 300px;height:auto;*/max-height: 130px;width: auto;} </style>\n")
file_object.write("<head><link rel=\"icon\" type=\"image/x-icon\" href=\""+contentfiles[0]+"\" /></head>\n")
file_object.write("<body>\n")
file_object.write("<h5>可以按住Ctrl + 鼠标滚轮 放大缩小页面,Ctrl + 0 重置页面</h5>\n")
file_object.write("<h5>"+effecttype+"分类</h5>\n")
for i in contentfiles:
file_object.write("<div class=\"left\"><a href=\""+i+"\" target=\"_blank\"><img class=\"pic\" src=\""+i+"\" ></a></div>\n")
file_object.write("</body>\n")
file_object.write("</html>\n")
else:
print("目标文件夹里没有图片文件(bmp,jpg,png,gif),请选择一个有这些图片类型的文件夹后重新生成网页")
return False
totalpath=xpath+"\\"+effecttype
totalpath=totalpath.replace("\\\\","\\")
print(totalpath+".html 网页制作完成")
os.system("explorer /select, "+'\"'+filename+'\"')
except Exception as _ex:
print("程序出现错误,请把下面的错误复制给制作者用于修改,谢谢!")
print("--------------------------------------------------------")
print('traceback.format_exc():\n%s' % traceback.format_exc())
print("--------------------------------------------------------")
print(effecttype+"网页制作失败,请联系制作者")
if __name__ == '__main__':
print("图片生成网页预览(gif,png,bmp,jpg) 吾爱破解论坛 52pojie.cn")
path=input("请粘贴或者拖拽一个图片文件夹的路径,用来生成网页:\r\n")
while True:
path=path.replace("\"", "")
if os.path.exists(path):
bool1 = path.endswith("\\")
if bool1:
path=path.strip('\\')
makeweb(path)
else:
print("目标文件夹不存在,请重新选择一个有效的文件夹来生成图片网页")
path=input("本次操作完毕,继续操作请再次粘贴或者拖拽一个图片文件夹的路径,结束请直接关闭本窗口:\r\n")
应用截图
相关文章
更多- Android SurFaceView的用法详解 2025-05-01
- Win10共享打印机709错误的原因及解决方法 2025-05-01
- 什么是binkw32.dll binkw32.dll丢失的解决方法 2025-05-01
- Python中split函数详解(参数说明、作用、用法) 2025-05-01
- 面向对象设计原则有哪些?每个原则是如何定义的? 2025-05-01
- C++中取整函数(ceil、floor、round)详解(定义、用法、示例) 2025-05-01
本类排行
- 1 小鱼便签
- 2 孔雀开会(Peacall)
- 3 小蜜蜂云工作
- 4 Mouse Without Borders(共享键鼠工具)
- 5 弹幕嵌入视频工具
- 6 微信界面透明度修改美化小工具
- 7 救援突击队官方
- 8 金牌班主任破解版
- 9 迷你三国军团
- 10 合成火锅