tag:blogger.com,1999:blog-5236867476487043111.post5651956091791965206..comments2024-03-11T07:55:47.104-04:00Comments on Corey Goldberg: Python - verify a PNG file and get image dimensionsCorey Goldberghttp://www.blogger.com/profile/06219872951977664560noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-5236867476487043111.post-72815767902188208532013-01-31T07:31:11.018-05:002013-01-31T07:31:11.018-05:00... (data[:8] == b'\211PNG\r\n\032\n' and ...... (data[:8] == b'\211PNG\r\n\032\n' and (data[12:16] == b'IHDR'))<br /> <br />... <br />print(is_png(data))<br />print(get_image_info(data))<br />...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5236867476487043111.post-44735446012626862262013-01-29T14:56:17.441-05:002013-01-29T14:56:17.441-05:00Nice snippet. ThanksNice snippet. ThanksAndriihttps://www.blogger.com/profile/05293235308400913381noreply@blogger.comtag:blogger.com,1999:blog-5236867476487043111.post-54293726221634621112013-01-29T09:55:30.298-05:002013-01-29T09:55:30.298-05:00yup, this is for Python 2.yup, this is for Python 2.Corey Goldberghttps://www.blogger.com/profile/06219872951977664560noreply@blogger.comtag:blogger.com,1999:blog-5236867476487043111.post-24723251942301766692013-01-29T09:45:26.932-05:002013-01-29T09:45:26.932-05:00Cool stuff! I assume this is Python 2.x only? It l...Cool stuff! I assume this is Python 2.x only? It looks like you're assuming byte strings.Shawn W.https://www.blogger.com/profile/12444125171642588003noreply@blogger.com