本地GIF圖生成網(wǎng)頁預(yù)覽工具能幫助用戶在瀏覽器中加載所有的gif動(dòng)圖,通過展示所有動(dòng)態(tài)效果的方式來讓用戶一次性預(yù)覽所有動(dòng)圖,不過對(duì)于內(nèi)存的需求比較大,可能有人使用時(shí)會(huì)出現(xiàn)過多加載的情況,從而導(dǎo)致死機(jī)等情況,想要預(yù)覽gif的用戶千萬別錯(cuò)過這個(gè)軟件。
軟件功能
電腦里有很多Gif圖,電腦的縮略圖只能生成靜幀的預(yù)覽圖,而可以通過這個(gè)生成個(gè)網(wǎng)頁,可以一下子預(yù)覽全部的動(dòng)態(tài)圖了。
當(dāng)然,也有個(gè)弊端,一次加載大量的gif到網(wǎng)頁上,會(huì)特別特別占內(nèi)存,就需要一個(gè)大內(nèi)存。
不過這都2021年了,誰還沒個(gè)十幾二十幾大幾十幾的內(nèi)存嘞?不過您內(nèi)存要是真的沒多大(比如電腦4g內(nèi)存,2g內(nèi)存),一定慎重加載超多圖片!!!
這次的創(chuàng)意. 來自獲取了一堆Gif后,懶著懶著突然有的靈感!
這次軟件特別好寫,要是有兄臺(tái)想模仿或者二次創(chuàng)作,請(qǐng)一定要艾特我呦!!!之前我寫的一些原創(chuàng),有些被人模仿去了,然沒見艾特我的就很郁悶..有艾特的我的就超開心!
軟件代碼
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 + 鼠標(biāo)滾輪 放大縮小頁面,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("目標(biāo)文件夾里沒有圖片文件(bmp,jpg,png,gif),請(qǐng)選擇一個(gè)有這些圖片類型的文件夾后重新生成網(wǎng)頁")
return False
totalpath=xpath+"\\"+effecttype
totalpath=totalpath.replace("\\\\","\\")
print(totalpath+".html 網(wǎng)頁制作完成")
os.system("explorer /select,"+'\"'+filename+'\"')
except Exception as _ex:
print("程序出現(xiàn)錯(cuò)誤,請(qǐng)把下面的錯(cuò)誤復(fù)制給制作者用于修改,謝謝!")
print("--------------------------------------------------------")
print('traceback.format_exc():\n%s' % traceback.format_exc())
print("--------------------------------------------------------")
print(effecttype+"網(wǎng)頁制作失敗,請(qǐng)聯(lián)系制作者")
if __name__ == '__main__':
print("圖片生成網(wǎng)頁預(yù)覽(gif,png,bmp,jpg) 吾愛破解論壇 52pojie.cn")
path=input("請(qǐng)粘貼或者拖拽一個(gè)圖片文件夾的路徑,用來生成網(wǎng)頁:\r\n")
while True:
path=path.replace("\"","")
if os.path.exists(path):
bool1 = path.endswith("\\")
if bool1:
path=path.strip('\\')
makeweb(path)
else:
print("目標(biāo)文件夾不存在,請(qǐng)重新選擇一個(gè)有效的文件夾來生成圖片網(wǎng)頁")
path=input("本次操作完畢,繼續(xù)操作請(qǐng)?jiān)俅握迟N或者拖拽一個(gè)圖片文件夾的路徑,結(jié)束請(qǐng)直接關(guān)閉本窗口:\r\n")
下載地址
精品推薦
-
eclipse中文補(bǔ)丁包
詳情 -
DiskGenius激活工具
詳情 -
橙子vr助手
詳情 -
Amtemu 2019
詳情 -
Enterprise Architect
詳情 -
balenaEtcher鏡像制作軟件
詳情 -
簡易多開
詳情 -
CADe SIMU
詳情 -
微信聊天記錄挖掘機(jī)
詳情 -
e900v21e刷機(jī)固件
詳情 -
Studio One6機(jī)架效果插件
詳情 -
windowsserver2012r2激活工具
詳情 -
cdr2020注冊(cè)機(jī)
詳情 -
云熙板式家具拆單軟件
詳情 -
abbyyCrack序列號(hào)注冊(cè)機(jī)
詳情 -
IC卡數(shù)據(jù)分析工具
詳情
裝機(jī)必備軟件
網(wǎng)友評(píng)論