how to mirror an image horizantaly?
i want either to mirror the image left to right or right to left from canvas center or to crop flip horizantaly. has to be done entirely by code. problem is when you flip horiztnaly it offsets the image and you have to manully place it. and ther eis no fixed ammount of pixels for this movement. any ideas how to get this done?
i have:
var doc = app.activeDocument;
// =======================================================
var idslct = charIDToTypeID( "slct" );
var desc48 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref40 = new ActionReference();
var idmarqueeRectTool = stringIDToTypeID( "marqueeRectTool" );
ref40.putClass( idmarqueeRectTool );
desc48.putReference( idnull, ref40 );
var iddontRecord = stringIDToTypeID( "dontRecord" );
desc48.putBoolean( iddontRecord, true );
var idforceNotify = stringIDToTypeID( "forceNotify" );
desc48.putBoolean( idforceNotify, true );
executeAction( idslct, desc48, DialogModes.NO );
// =======================================================
var idsetd = charIDToTypeID( "setd" );
var desc49 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref41 = new ActionReference();
var idChnl = charIDToTypeID( "Chnl" );
var idfsel = charIDToTypeID( "fsel" );
ref41.putProperty( idChnl, idfsel );
desc49.putReference( idnull, ref41 );
var idT = charIDToTypeID( "T " );
var desc50 = new ActionDescriptor();
var idTop = charIDToTypeID( "Top " );
var idPxl = charIDToTypeID( "#Pxl" );
desc50.putUnitDouble( idTop, idPxl, 0.000000 );
var idLeft = charIDToTypeID( "Left" );
var idPxl = charIDToTypeID( "#Pxl" );
desc50.putUnitDouble( idLeft, idPxl, 0.000000 );
var idBtom = charIDToTypeID( "Btom" );
var idPxl = charIDToTypeID( "#Pxl" );
desc50.putUnitDouble( idBtom, idPxl, doc.height.value );
var idRght = charIDToTypeID( "Rght" );
var idPxl = charIDToTypeID( "#Pxl" );
desc50.putUnitDouble( idRght, idPxl, doc.width.value/2 );
var idRctn = charIDToTypeID( "Rctn" );
desc49.putObject( idT, idRctn, desc50 );
executeAction( idsetd, desc49, DialogModes.NO );
// =======================================================
var idDlt = charIDToTypeID( "Dlt " );
executeAction( idDlt, undefined, DialogModes.NO );
// =======================================================
var idsetd = charIDToTypeID( "setd" );
var desc51 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref42 = new ActionReference();
var idChnl = charIDToTypeID( "Chnl" );
var idfsel = charIDToTypeID( "fsel" );
ref42.putProperty( idChnl, idfsel );
desc51.putReference( idnull, ref42 );
var idT = charIDToTypeID( "T " );
var idOrdn = charIDToTypeID( "Ordn" );
var idNone = charIDToTypeID( "None" );
desc51.putEnumerated( idT, idOrdn, idNone );
executeAction( idsetd, desc51, DialogModes.NO );