Solved

FTP JPEG re-directing based on EXIF Orientation data

Posted on 2013-01-23
2
229 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
2 Comments
 
LVL 69

Accepted Solution

by:
Merete earned 250 total points
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I have a Synology DS212+ NAS.  These are not only great for backup and normal NAS stuff, but also for delivering media throughout your home or LAN via DLNA.  I copied my whole audio collection from iTunes over to the box, but couldn't figure out how…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
Viewers will learn how to turn a Live Set into a compressed Live Pack file, and how to install Live Packs. Make: File > Collect All And Save: File > Manage Files: Click Manage Project: Click Create Pack: Select save location: Install: Doub…
Viewers will learn how to create and use Simpler instruments in Ableton Live. Load new Simpler into an empty MIDI track: Select a sample and drop it into sample window in Simpler: If sample is not pitched at C3, adjust tuning with Transpose para…

744 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now