Solved

FTP JPEG re-directing based on EXIF Orientation data

Posted on 2013-01-23
2
233 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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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…
You may or may not be familiar with Kodi (http://www.kodi.tv) the open source software media player and entertainment hub that can be installed on Linux, OSX, Windows, iOS, and Android.  Kodi which started off as X-Box Media Center (XBMC) many years…
This video will give a brief orientation and organization of Logic Pro X, and how to access different work spaces quickly with keyboard shortcuts.
Viewers will learn how to use LFOs to modulate the sound of their Sampler instruments. Click the Modulation tab in Sampler: Choose one (or more) of the three available LFOs, and click the respective button to turn it on: Select a waveform, an LF…

863 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

25 Experts available now in Live!

Get 1:1 Help Now