Solved

FTP JPEG re-directing based on EXIF Orientation data

Posted on 2013-01-23
2
248 Views
Last Modified: 2013-04-08
Is there any FTP program (or any program) that in realtime, redirect for JPEGS to specific folder based on it's EXIF orientation data (landscape or portrait)?
0
Comment
Question by:abs-ptony
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

Accepted Solution

by:
Merete earned 250 total points
ID: 38813816
Not that I know when you understand that  FTP is just a File Transfer Protocol, using a standard network protocol to transfer files from one host or to another host over a TCP-based network, such as the Internet.
It has no other way / method api to read or identify with the source files unless you can rewrite the syntax.
And the syntax is created in the source folder and must natch the directory output usualy a web page etc
Here is a list of syntax
http://en.wikipedia.org/wiki/File_Transfer_Protocol#List_of_FTP_commands

http://insightfuldevelopment.com/how-to-use-ftp-website-files-folders-directory/
0
 
LVL 38

Assisted Solution

by:BillDL
BillDL earned 250 total points
ID: 38814291
Hi abs-ptony

I cannot think that too many people will ever have had the need to do what you need, but you never know.  Somebody may well have had to write their own application, but I have never come across such all-in-one program.

If you wouldn't mind doing this from the command line and using two separate little programs, then this could be scripted in a "DOS" batch file or VBScript.  For example I have used a little standalone command line "Exif Reader" program that can be called from a batch file to extract the orientation code (or description which is less helpful) and then, dependent on what code is returned, the batch file could then issue a different FTP command, one to upload to a "portrait mode" folder and the other to a "landscape mode" folder.

Windows has its own native command line driven FTP client program:
http://ss64.com/nt/ftp.html
Generally you run it by specifying a script file that it walks through.

I'm assuming that you would be working with just a few local folders containing quite a few images to upload at one time.  That being the case a batch file can be made to walk through all folders and sub-folders starting from a specified path processing any JPGs it finds, or to process a list of images.  That part isn't a problem.

I have used the little ExifTool program by Phil Harvey for various purposes in the past:
http://www.sno.phy.queensu.ca/~phil/exiftool/
In this case we could just use it to read the orientation code as an integer from a JPG:
REM http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html#reading_examples

The thing about EXIF orientation codes is that it's not quite as simple as "portrait" or "landscape".  For instance, if you held the camera in landscape mode upside down it would store a different orientation code in the EXIF tags than holding it in landscape mode the right way up.  The Exif specification defines an Orientation Tag to indicate the orientation of the camera relative to the captured scene.  The codes are explained visually here:

REM http://sylvana.net/jpegcrop/exif_orientation.html
REM http://www.impulseadventure.com/photo/exif-orientation.html

It would be relatively easy in a batch file to do an "IF value=n THEN" type test of the returned code to determine if it was landscape (correct way up or upside down) or if it was portrait mode (camera rotated left or right) and detect it as landscape or portrait.

If you are open to using a batch file, a 3rd-party Exif reading program, and either built-in Windows FTP or any number of 3rd-party command line programs, then perhaps the easiest way to verify whether this is likely to work would be for you to attach samples of a portrait and landscape JPG image.

Let us know what you think.

Bill
0

Featured Post

Webinar: MongoDB® Index Types

Join Percona’s Senior Technical Services Engineer, Adamo Tonete as he presents “MongoDB Index Types, How, When and Where Should They be Used?” on Wednesday, July 12, 2017 at 11:00 am PDT / 2:00 pm EDT (UTC-7).

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Keep your audience engaged and get the most out of your next presentation with these quick Prezi tips.
Many programs have tried to outwit PowerPoint in terms of technology and skill. These programs, however, still lack several characteristics that PowerPoint has possessed from the start. Here's why PowerPoint replacements won't entirely work for desi…
Viewers will get an overview of how to make and use Drum Racks in Ableton Live. Load new Drum Rack into empty MIDI track: Fill rack with audio samples: Re-arrange sample slots as necessary: Adjust parameters of each slot to tailor each sound a…
Viewers will learn the basics of making and using Impulse Kits in Ableton Live. Load new Impulse into an empty MIDI track: Fill the 8 empty sample slots with drum samples: Adjust parameters to tailor each sound as desired: Proceed to create be…

631 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question