Select to view content in your preferred language

ExportToJPG

548
2
01-15-2014 10:07 AM
PattyRueger
Deactivated User
Greetings,
I have written a python script to automate the export of a data frame to jpg, including a world file so I can use the resulting image in other processes.....  (I am consuming an image service that I would like to use for localized image processing)

my code is as follows:

arcpy.mapping.ExportToJPEG(myMXD, myImage, myDataFrame,4171, 3629,400,True)

When I enter the same values (width, height, dpi) and export the data frame manually (via the wizard), I get a lovely clipped image.
The export wizard automatically generates the width and height based on the dpi value (400). 

When I run the code, the image is narrower than it should be.  ( the image is 'squished')
Any thoughts?
Thank you in advance!
Patty Rueger
Tags (2)
2 Replies
MarcoBoeringa
MVP Alum
I am not entirely sure. I only used ExportToJPEG on Page Layouts, where I didn't need to set the width and height.

I guess the issue may be with using width and height values not conforming to the ratio of width / height of your visible data frame in ArcMap, and ArcGIS trying to squeeze the display of the data frame in the changed image aspect.

E.g. if the data frame in ArcMap has a width / height size of 640 / 480, so a 4:3 ratio, you may need to use a similar ratio for the export width / height too, e.g. 1600 / 1200.

But this is a guess... someone with more Python experience will probably answer your question better.
0 Kudos
DanPatterson_Retired
MVP Emeritus
Check the last scripting output in the help file,
http://resources.arcgis.com/en/help/main/10.2/index.html#//00s300000038000000
it indeed allows for increased resolution
0 Kudos