File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -14,12 +14,16 @@ def get_paste_img_file():
1414 pb = NSPasteboard .generalPasteboard ()
1515 data_type = pb .types ()
1616 # if img file
17- # print data_type
17+ print data_type
1818 # always generate png format img
1919 png_file = tempfile .NamedTemporaryFile (suffix = "png" )
2020
2121 supported_image_format = (NSPasteboardTypePNG , NSPasteboardTypeTIFF )
22- if any (filter (lambda f : f in data_type , supported_image_format )):
22+ if NSPasteboardTypeString in data_type :
23+ # make this be first, because plain text may be TIFF format?
24+ # string todo, recognise url of png & jpg
25+ pass
26+ elif any (filter (lambda f : f in data_type , supported_image_format )):
2327 # do not care which format it is, we convert it to png finally
2428 # system screen shotcut is png, QQ is tiff
2529 tmp_img_file = tempfile .NamedTemporaryFile ()
@@ -33,11 +37,7 @@ def get_paste_img_file():
3337 # close the file explicitly
3438 tmp_img_file .close ()
3539 return png_file
36-
37- elif NSPasteboardTypeString in data_type :
38- # string todo, recognise url of png & jpg
39- pass
40-
40+
4141if __name__ == '__main__' :
4242 get_paste_img_file ()
4343
You can’t perform that action at this time.
0 commit comments