看板 [ Python ]
討論串[問題] 如何檢查圖片是否和毀損
共 7 篇文章
首頁
上一頁
1
2
下一頁
尾頁

推噓1(1推 0噓 1→)留言2則,0人參與, 6年前最新作者alvinlin (艾爾文)時間6年前 (2019/07/30 19:24), 6年前編輯資訊
0
1
0
內容預覽:
可以用 py_compile 偽編譯成 .pyc. https://i.imgur.com/iXnOGzL.jpg. -----. Sent from JPTT on my iPhone. --. 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.192.186.172 (臺灣).

推噓4(4推 0噓 2→)留言6則,0人參與, 6年前最新作者alvinlin (艾爾文)時間6年前 (2019/07/30 18:57), 6年前編輯資訊
0
1
0
內容預覽:
試著把內容印出來就會找到解決方案。. import os. import imghdr. path = 'Z://oswalk'. for root, dirs, files in os.walk(path):. for f in files:. print(os.path.join(root, f
(還有130個字)

推噓0(0推 0噓 3→)留言3則,0人參與, 6年前最新作者s4028600 (佑)時間6年前 (2019/07/30 00:42), 6年前編輯資訊
0
0
0
內容預覽:
import os. path = 'D:\long\Desktop\image\\'. def is_valid_jpg(jpg_file):. with open(jpg_file, 'rb') as f:. f.seek(-2, 2). buf = f.read(). return buf =
(還有1143個字)

推噓4(4推 0噓 7→)留言11則,0人參與, 6年前最新作者alvinlin (艾爾文)時間6年前 (2019/07/29 02:43), 編輯資訊
0
4
1
內容預覽:
幫你簡化一下。. from PIL import Image. import os. import imghdr. def is_valid_image(filename):. valid = True. try:. Image.open(filename).load(). except OSErr
(還有759個字)

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者alvinlin (艾爾文)時間6年前 (2019/07/29 02:18), 編輯資訊
0
2
1
內容預覽:
那好吧。來個專屬版給你的。. from PIL import Image. import os. def is_valid_image(filename):. valid = True. try:. Image.open(filename).load(). except OSError:. vali
(還有359個字)
首頁
上一頁
1
2
下一頁
尾頁