- checkProg('an EPS -> PNG converter', ['magick $$i[0] $$o', 'convert $$i[0] $$o'],
- rc_entry = [ r'\converter eps png "%%" ""'])
+ # Due to more restrictive policies, it is possible that (image)magick
+ # does not allow conversions from eps to png.
+ # So before setting the converter test it it on a mock file
+ _, cmd = checkProg('an EPS -> PNG converter', ['magick', 'convert'])
+ if cmd:
+ writeToFile('mock.eps', r'%!PS')
+ try:
+ subprocess.check_call([cmd, "mock.eps", "mock.png"])
+ removeFiles(['mock.eps', 'mock.png'])
+ rc_entry = r'\converter eps png "%s $$i[0] $$o" ""'
+ addToRC(rc_entry % cmd)
+ except:
+ removeFiles(['mock.eps'])
+ #needs empty record otherwise default converter will be issued
+ rc_entry = r'\converter eps png "" ""'
+ addToRC(rc_entry)
+ logger.info('ImageMagick seems to ban conversions from EPS. Disabling direct EPS->PNG.')