That seems to be about 46 more lines than one actually needs in PHP.
Although it also seems to be 3 lines more than one needs in CFML as well, for that matter. But I haven't done image manipulation in CFML so there could be more to it than I'm reading in the docs.