Hi Liam,
I wanted to know why do you need committed object, i have used this on uncommitted image object passed as a parameter , I have attached image below you can see the return value is true and it did get compressed.
I am using mxtechies module for this java action
Let me know if you need further help
Good luck!