Code: Select all
convert -density 300 foo.eps -resize "10000x10000>" foo.png
Then one day somebody uploaded a 64kb .eps file that had resolution identified as 5000x7000. This crashed the server, because (if I understand correctly) it tried to blow up a 5x7k image 300 times in memory. This is what I mean by "safe" - this shouldn't happen. So adding -density 300 makes most vectors look good, but some could crash the server. Removing -density 300 makes most vectors look bad - they become tiny PNGs, but server doesn't die. Hence the question:
Could you recommend a safe, consistent way to do this? It's ok if some vectors can be identified "broken" - we can show error to the customer. As long as there is a way. It's also ok to guess things. After image is uploaded we first "identify" it, which means we can write code to react to whatever it discovered.
Appreciate any advice!