Code snippet for image resize

How to reduce image size. New size is size/4. Here ad->fileList[ad->curIndex] is some char string with path to file. Privilege http://tizen.org/privilege/mediastorage should be added in manifest.