imagemagick - resize image to specific height and width value using im4java? -


i need re-size image specific height , width value. i'm not getting resized result. here code, please tell me either i'm doing wrong or missing something.

imoperation operationsmall = new imoperation();         operationsmall.addimage("conf/error.png");         operationsmall.resize(300, 1000); // w*h         operationsmall.addimage("conf/errir_small.png"); 

original image size: 1280x960 px. re-sized image size: 300x225

i tried give different values, i'm having issues in height. doc not complete , no code example find on internet except using scale (it skip filtering) may solve problem. how use scale in code have not idea.

i don't read or understand java much, @ command-line need exclamation mark force imagemagick disregard aspect ratio , resize exact/specific dimensions, this:

convert -resize 300x200! image....  

in java docs, there seems option of adding special 3rd parameter, guess may need

operationsmall.resize(300,1000,'!'); 

or similar... or maybe java uses double quotes rather single quotes suggested.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -