add a generic version of withTempCompressed that allows arbitrary modification