Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 346088 Details for
Bug 466190
=gnome-extra/nm-applet with media-libs/libpng-1.6 - Icon nm-signal-75 missing: (0) Fatal error reading PNG image file: Decompression error in IDAT
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
parallel PNG checker
pngchecker.py (text/x-python), 1.60 KB, created by
Tobias Klausmann (RETIRED)
on 2013-04-20 13:08:31 UTC
(
hide
)
Description:
parallel PNG checker
Filename:
MIME Type:
Creator:
Tobias Klausmann (RETIRED)
Created:
2013-04-20 13:08:31 UTC
Size:
1.60 KB
patch
obsolete
>#!/usr/bin/python3 -tt ># Copyright 2013 T. Klausmann. ># Licensed under the GPL-2. >""" >Check PNG files supplied on stdin for "IDAT: invalid distance too far back" >errors. >""" > > >import multiprocessing >import os >import subprocess >import sys >import time > >JOBS = 8 # Number of jobs to run in parallel. > >def test_one_file(filename): > """ > Test one file by using ImageMagick's convert tool > > Tries to convert the file to /tmp/garbage.png. If the return value is not > zero _and_ the string "IDAT: invalid distance too far back" is in convert's > stdout, return the filename. Otherwise, return None. Does not clean up > /tmp/garbage.png. > """ > cmd = "convert '%s' /tmp/garbage.png" % (filename) > (retval, output) = subprocess.getstatusoutput(cmd) > with open("/tmp/pngfixer/checker.%i.log" % os.getpid(), "w") as logfd: > logfd.write(output) > if retval != 0 and "IDAT: invalid distance too far back" in output: > return filename > >def main(): > """Main program.""" > pool = multiprocessing.Pool(processes=JOBS) > # If your filesystem contains files with \n in their names, you need to seek > # help. > inputfiles = sys.stdin.read().split("\n") > start = time.time() > result = pool.map(test_one_file, inputfiles) > end = time.time() > timedelta = end-start > amount = len(inputfiles) > print("Checked %s files in %.2f seconds, %.2f files/s." % > (amount, timedelta, amount/timedelta)) > # Drop instances of None > result = [ x for x in result if x ] > > print("%s files need fixing." %(len(result))) > print("\n".join(result)) > >if __name__ == "__main__": > main() > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 466190
:
345742
|
345816
|
346084
| 346088 |
346192