void reorientate() { switch(MagickGetImageOrientation(magick_wand)) { //todo: separate out rotate logic case TopRightOrientation: MagickFlopImage(magick_wand); break; case BottomLeftOrientation: MagickFlopImage(magick_wand); //continue to BottomRightOrientation case BottomRightOrientation: rotate(EIM_ROTATE_180); break; case RightBottomOrientation: MagickFlopImage(magick_wand); //continue to RightTopOrientation case RightTopOrientation: rotate(EIM_ROTATE_90); break; case LeftTopOrientation: MagickFlopImage(magick_wand); case LeftBottomOrientation: rotate(EIM_ROTATE_270); break; default: break; } }
apr_status_t dims_flipflop_operation (dims_request_rec *d, char *args, char **err) { if(args != NULL) { if(strcmp(args, "horizontal") == 0) { MAGICK_CHECK(MagickFlopImage(d->wand), d); } else if (strcmp(args, "vertical") == 0) { MAGICK_CHECK(MagickFlipImage(d->wand), d); } } return DIMS_SUCCESS; }