rotation of our pictures via xlobby

Got an idea, post it here

rotation of our pictures via xlobby

Postby dgemily on Sat Nov 06, 2004 11:37 am

Hy Steven,

Is it possible to add a function to rotate our photos ( 90° at the right and left side) .
That is my principal request about the photos section, but if you can add transition effects and print function, it will be marvellous. :D
I tried to find a freeware that we can use by command line or by keyboard shortcuts, with these 3 functions (rotation + transition effects + print function) but I didn’t find. :cry:
I know that irfanview can be used with command lines, and xnview can be used via keyboard shortcuts but I didn’t find transition effects with those programs.
If someone know a freeware with those functions or a tips to use transition effects with irfanview or xnview, could you please tell me these.

Thanks,
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby jowaldo on Sun Nov 07, 2004 5:14 am

I asked for this a while ago, and steven said it would be pretty hard for him to add, so I doubt it would be possible at least any time soon
jowaldo
 
Posts: 903
Joined: Wed May 21, 2003 7:17 pm

Postby dalanik on Mon Nov 08, 2004 8:52 am

Well, at least picture rotation? :-) 90 degrees left/right? It is real pain when I download photos to XLobby from camera to have to go to ifran view in order to rotate 'em first...

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby dgemily on Mon Nov 08, 2004 9:18 am

Dalibor,

if you want, you can use irfanview with xlobby and use command line to rotate the photos:

- rotate input image to right
Code: Select all
/rotate_r


- rotate input image to left
Code: Select all
/rotate_l


I didn't try it, but it should work...
( all the command lines are listed in the file "i_options.txt" of the irfanview repertory's)

but, the problem is that you need to use an other photos viewer's (than the viewer inside xlobby), and configure all the photos section's of xlobby, only to rotate the photos :( .

Later,
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby dalanik on Mon Nov 08, 2004 9:38 am

dgemily wrote:but, the problem is that you need to use an other photos viewer's (than the viewer inside xlobby), and configure all the photos section's of xlobby, only to rotate the photos :( .

Later,


Exactly. Too much hassle for such a small issue...
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby badubo on Mon Nov 08, 2004 11:28 am

May be this link can be helpfull

http://www.codeproject.com/cs/media/JPEGviewer.asp

The best way is to allow to rotate images then allow to save the EXIF data so that next time, the image is correctly loaded.

Of course, It must be done inside xlobby... (sorry Steven :oops: )

Don't know if another front end has this feature
badubo
 
Posts: 505
Joined: Mon May 03, 2004 7:33 pm
Location: Belgium

Postby ingalls on Mon Nov 08, 2004 12:09 pm

I'm interested to for this feature!!
ingalls
 
Posts: 193
Joined: Wed May 12, 2004 7:46 pm

rotate

Postby lar282 on Tue Feb 01, 2005 9:56 am

steven is it possible to add rotation to Xlobby. would be a really nice feature.

found code to do it. Doesn't seem to be that hard.

using System;
using System.Windows.Forms;
using System.Drawing;
using System.Text;
using System.Drawing.Imaging;
using System.IO;

public class win:Form {

Stream stm;
Panel pnlTop;
StatusBar stbBtm;
Label lblPicMode;
MainMenu mnuMain;
PictureBox pbxImg;
bool blnPicLoaded;
ComboBox cmbPicMode;
OpenFileDialog dlgFile;
Button btnTransform,btnOrg;
GroupBox gpbRotate,gpbFlip;
MenuItem mnuFile, mnuOpen, mnuSave, mnuExit, mnuSep;
String strImgName,strRot,strFlip,strRotFlip,strStatus;
RadioButton rbnRotNone,rbnRotX,rbnRotY,rbnRotXY,rbnFlipNone,rbnFlip90,rbnFlip180,rbnFlip270,rbnTemp;

public win() {
try {
this.Text="Images";
pnlTop=new Panel();

this.Size=new Size(770,570);
this.Controls.Add(pnlTop);
this.Menu=fncBuildMenus();

setControls();

strRot=rbnRotNone.Name;
strFlip=rbnFlipNone.Name;
pnlTop.Location = new Point(0,0);
pnlTop.Size = new Size(750,500);
}

catch (Exception e) {
Console.WriteLine("error ...... " + e.StackTrace);
}
}

private static void Main() {
Application.Run(new win());
}

private MainMenu fncBuildMenus() { /* build the menu's */
mnuMain=new MainMenu();
mnuFile=new MenuItem();
mnuOpen=new MenuItem();
mnuSave=new MenuItem();
mnuExit=new MenuItem();
mnuSep=new MenuItem();
mnuFile.Text="&File";
mnuOpen.Text="&Open";
mnuSave.Text="Save &As";
mnuExit.Text="E&xit";
mnuSep.Text="-";
mnuFile.MenuItems.Add(mnuOpen);
mnuFile.MenuItems.Add(mnuSave);
mnuFile.MenuItems.Add(mnuSep);
mnuFile.MenuItems.Add(mnuExit);
mnuMain.MenuItems.Add(mnuFile);
mnuOpen.Click+=new EventHandler(fncOpen);
mnuSave.Click+=new EventHandler(fncSave);
mnuExit.Click+=new EventHandler(fncExit);
return mnuMain;
}

private void setControls() {
/* initialize and add the controls to the form. */
gpbRotate = new GroupBox();
gpbRotate.Location = new Point(0,0);
gpbRotate.Size=new Size(300,50);
gpbRotate.Text = "Rotate";
gpbFlip = new GroupBox();
gpbFlip.Location = new Point(300,0);
gpbFlip.Size = new Size(300,50);
gpbFlip.Text = "Flip";

rbnRotNone = fncRadBtns("None","None",50,10,20);
rbnFlipNone = fncRadBtns("None","None",50,10,20);
rbnRotX = fncRadBtns("90 deg","90",70,80,20);
rbnRotY = fncRadBtns("180 deg","180",70,150,20);
rbnRotXY = fncRadBtns("270 deg","270",70,220,20);
rbnFlip90 = fncRadBtns("X - axis","X",70,80,20);
rbnFlip180 = fncRadBtns("Y - axis","Y",70,150,20);
rbnFlip270 = fncRadBtns("XY - axis","XY",70,220,20);
rbnRotNone.Checked = true;
rbnFlipNone.Checked = true;

btnTransform = new Button();
btnTransform.Text="Transform Image";
btnTransform.Location = new Point(0,65);
btnTransform.Width=100;

btnOrg = new Button();
btnOrg.Text = "Original Position";
btnOrg.Location = new Point(200,65);
btnOrg.Width = 100;

lblPicMode = new Label();
lblPicMode.Text = "Picture Mode ";
lblPicMode.Location = new Point(350,67);
lblPicMode.Width = 70;

cmbPicMode = new ComboBox();
cmbPicMode.Location = new Point(420,65);
cmbPicMode.DropDownStyle=ComboBoxStyle.DropDownList;
cmbPicMode.Items.Add("Auto Size");
cmbPicMode.Items.Add("Center Image");
cmbPicMode.Items.Add("Normal");
cmbPicMode.Items.Add("Stretch Image");
cmbPicMode.SelectedIndex=2;

pbxImg = new PictureBox();
pbxImg.Location = new Point(0,100);
pbxImg.Size = new Size(750,400);

stbBtm=new StatusBar();
stbBtm.Text = "Normal mode - Image is clipped if it is bigger than the Picture Box.";
stbBtm.BackColor=Color.Green;
stbBtm.Size=new Size(750,20);
stbBtm.Location = new Point(0,550);

gpbRotate.Controls.Add(rbnRotNone);
gpbRotate.Controls.Add(rbnRotX);
gpbRotate.Controls.Add(rbnRotY);
gpbRotate.Controls.Add(rbnRotXY);

gpbFlip.Controls.Add(rbnFlipNone);
gpbFlip.Controls.Add(rbnFlip90);
gpbFlip.Controls.Add(rbnFlip180);
gpbFlip.Controls.Add(rbnFlip270);

pnlTop.Controls.Add(gpbRotate);
pnlTop.Controls.Add(gpbFlip);
pnlTop.Controls.Add(btnTransform);
pnlTop.Controls.Add(btnOrg);
pnlTop.Controls.Add(lblPicMode);
pnlTop.Controls.Add(cmbPicMode);
Controls.Add(stbBtm);
pnlTop.Controls.Add(pbxImg);
blnPicLoaded=false;
strStatus=stbBtm.Text;
}

private RadioButton fncRadBtns(String strText,String strName,int intWidth,int intX,int intY) {
RadioButton rbnTmp;
rbnTmp = new RadioButton();
rbnTmp.Text = strText;
rbnTmp.Name = strName;
rbnTmp.Width = intWidth;
rbnTmp.Location = new Point(intX,intY);
return rbnTmp;
}
private void fncOpen(object obj,EventArgs ea) { /* load the picture. */
try{
dlgFile=new OpenFileDialog();
dlgFile.Filter="JPEG Images (*.jpg,*.jpeg)|*.jpg;*.jpeg|Gif Images (*.gif)|*.gif|Bitmaps (*.bmp)|*.bmp";
dlgFile.FilterIndex=1;

if (dlgFile.ShowDialog()== DialogResult.OK)
{ if((stm=dlgFile.OpenFile())!=null) {
strImgName=dlgFile.FileName;
stm.Close();
pbxImg.Image=Image.FromFile(strImgName);
blnPicLoaded=true;
}
}
if (blnPicLoaded) { /* if the picture is loaded then enable the events. */
rbnRotNone.Click+=new EventHandler(fncRot);
rbnRotX.Click+=new EventHandler(fncRot);
rbnRotY.Click+=new EventHandler(fncRot);
rbnRotXY.Click+=new EventHandler(fncRot);
rbnFlipNone.Click+=new EventHandler(fncFlip);
rbnFlip90.Click+=new EventHandler(fncFlip);
rbnFlip180.Click+=new EventHandler(fncFlip);
rbnFlip270.Click+=new EventHandler(fncFlip);
btnTransform.Click+= new EventHandler(fncTransform);
btnOrg.Click += new EventHandler(fncTransform);
cmbPicMode.SelectionChangeCommitted += new EventHandler(fncPicMode);
}
}
catch(Exception e) {
Console.WriteLine(e.StackTrace);
}
}

private void fncSave(object sender, EventArgs ea) {
try { /* save the image in the required format. */
SaveFileDialog dlgSave = new SaveFileDialog();
dlgSave.Filter="JPEG Images (*.jpg,*.jpeg)|*.jpg;*.jpeg|Gif Images (*.gif)|*.gif|Bitmaps (*.bmp)|*.bmp";
if (dlgSave.ShowDialog()==DialogResult.OK) {
strImgName=dlgSave.FileName;
if (strImgName.EndsWith("jpg"))
pbxImg.Image.Save(strImgName,ImageFormat.Jpeg);
if (strImgName.EndsWith("gif"))
pbxImg.Image.Save(strImgName,ImageFormat.Gif);
if (strImgName.EndsWith("bmp"))
pbxImg.Image.Save(strImgName,ImageFormat.Bmp);
}
}
catch(Exception e) {
Console.WriteLine(e.StackTrace);
}
}


private void fncRot(object obj,EventArgs ea) {
rbnTemp = (RadioButton)obj;
strRot=rbnTemp.Name;
setStatus();
}

private void fncFlip(object obj,EventArgs ea) {
rbnTemp = (RadioButton)obj;
strFlip = rbnTemp.Name;
setStatus();
}
private void fncTransform(object obj,EventArgs ea) {
Button btnTemp=(Button)obj;

if (btnTemp.Text=="Transform Image") {

strRotFlip=strRot + strFlip;
switch (strRotFlip) {

case "180None" :
pbxImg.Image.RotateFlip(RotateFlipType.Rotate180FlipNone);
break;
case "180X" :
pbxImg.Image.RotateFlip(RotateFlipType.Rotate180FlipX);
break;
case "180Y" :
pbxImg.Image.RotateFlip(RotateFlipType.Rotate180FlipY);
break;
case "180XY" :
pbxImg.Image.RotateFlip(RotateFlipType.Rotate180FlipXY);
break;
case "270None" :
pbxImg.Image.RotateFlip(RotateFlipType.Rotate270FlipNone);
break;
case "270X" :
pbxImg.Image.RotateFlip(RotateFlipType.Rotate270FlipX);
break;
case "270Y" :
pbxImg.Image.RotateFlip(RotateFlipType.Rotate270FlipY);
break;
case "270XY" :
pbxImg.Image.RotateFlip(RotateFlipType.Rotate270FlipXY);
break;
case "90None" :
pbxImg.Image.RotateFlip(RotateFlipType.Rotate90FlipNone);
break;
case "90X" :
pbxImg.Image.RotateFlip(RotateFlipType.Rotate90FlipX);
break;
case "90Y" :
pbxImg.Image.RotateFlip(RotateFlipType.Rotate90FlipY);
break;
case "90XY" :
pbxImg.Image.RotateFlip(RotateFlipType.Rotate90FlipXY);
break;
case "NoneNone" :
pbxImg.Image.RotateFlip(RotateFlipType.RotateNoneFlipNone);
break;
case "NoneX" :
pbxImg.Image.RotateFlip(RotateFlipType.RotateNoneFlipX);
break;
case "NoneY" :
pbxImg.Image.RotateFlip(RotateFlipType.RotateNoneFlipY);
break;
case "NoneXY" :
pbxImg.Image.RotateFlip(RotateFlipType.RotateNoneFlipXY);
break;
default :
pbxImg.Image.RotateFlip(RotateFlipType.RotateNoneFlipNone);
break;
}
}
else if (btnTemp.Text=="Original Position") {
pbxImg.Image=Image.FromFile(strImgName);
pbxImg.Refresh();
}
pbxImg.Refresh();
}

private void fncPicMode(object obj,EventArgs ea) {
ComboBox objTemp = (ComboBox)obj;
switch (objTemp.SelectedIndex) {

case 0 :
pbxImg.SizeMode=PictureBoxSizeMode.AutoSize;
strStatus="AutoSize mode - The PictureBox is sized equal to the size of the image that it contains.";
break;
case 1 :
pbxImg.SizeMode=PictureBoxSizeMode.CenterImage;
strStatus="CenterImage mode - Image is placed in the center of the Picture Box.";
strStatus=strStatus + "If the image is big then outside edges of Image is clipped.";
break;
case 2 :
pbxImg.SizeMode=PictureBoxSizeMode.Normal;
strStatus="Normal mode - Image is clipped if it is bigger than the Picture Box.";
break;
case 3 :
pbxImg.SizeMode=PictureBoxSizeMode.StretchImage;
strStatus="Stretch mode - Image is stretched or shrunk to fit the Picture Box.";
break;
}
pbxImg.Refresh();
stbBtm.Text=strStatus;
}
private void setStatus() {

strStatus="The Image is rotated ";
if (strRot != null && strRot != "None")
strStatus=strStatus + strRot + " degrees";
if (strFlip !=null && strFlip != "None")
strStatus=strStatus +" around " + strFlip + " axis.";

stbBtm.Text=strStatus;

}
private void fncExit(object obj,EventArgs ea) {
Application.Exit();
}
}
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby stevenhanna6 on Wed Feb 02, 2005 7:13 am

I'm trying to understand what you guys want

1. method to rotate picture right 90 degrees and save
2. method to rotate picture left 90 degrees and save
3. read EXIF orientation data and display picture (DO NOT MODIFY)
4. change EXIF orientation and reload

I guess its all 4?
stevenhanna6
 
Posts: 904
Joined: Tue Feb 18, 2003 10:39 am
Location: Ontario, Canada

Postby lar282 on Wed Feb 02, 2005 7:41 am

YES, but its the rotation no save thats important for me, since that doesn't modify the picture at all
//Lase
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby dgemily on Wed Feb 02, 2005 9:39 am

Rotate and save will be enough for my utility, I think the first and the second guesses will be more important than the 2 others but maybe someone needs them ….?

thx,

Dge
dgemily
 
Posts: 793
Joined: Thu May 13, 2004 6:24 am
Location: Paris, France

Postby Colby on Wed Feb 02, 2005 1:58 pm

I dont know what you have planned for pic rotation steve, but I would like it if maybe the rotation could be xlobby db entries. suppose I have a picture of the sky, it wouldnt make any difference what orientation it was to correctly view, but I would want to click rotate and it change 90 deg from how its currently displayed. if I click rotate again I would want it 90 deg again. (so its upside down)

The database structure would be as follows. Pictures and coverart are imported with the tag "Orientation:N" when I click rotate it would change to "Orientation:E, Orientation:S, then Orientation:W". With the database like this I could easily make a button called landscape or portrait, or flip or whatever.

The actual picture never gets saved but its orientation within xlobby is saved.

Is that possible or a bad idea?
Colby
 
Posts: 929
Joined: Mon Feb 02, 2004 7:42 am
Location: Brookline Station, MO, USA

Postby dalanik on Wed Feb 02, 2005 2:22 pm

Dunno... If this wouldn't slow down pics display, maybe it's not a bad idea...

But for normal photos usage, I don't see any advantage of leaving the pictures with original rotation - I'd still like my photos rotated correctly anyway! :-) If the saved version is of the same quality of original, ofcourse.

D.
dalanik
 
Posts: 885
Joined: Mon Apr 19, 2004 12:35 pm
Location: Prague, Czech Republic

Postby lar282 on Wed Feb 09, 2005 7:37 am

Steven is this something u might add? If not let us know, cause I'm gonna TRY and write a plugin for it then.


//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Postby lar282 on Mon May 09, 2005 10:59 am

Would be nice to have this feature in xlobby. Not sure if I CAN write a plugin for it.


//Lasse
lar282
 
Posts: 1624
Joined: Thu Apr 01, 2004 4:13 pm
Location: Helsingborg, Sweden

Next