Hi Douglas,

You can do this in code. For example, here is some code I use:

GET PICTURE METADATA($gPicture;TIFF orientation;$lOrientation)
Case of 
   : ($lOrientation=1)  //Normal, no rotation needed
                                        
   : ($lOrientation=8)  //Left 90˚, so need to rotate right 90˚
      $gPicture:=Photo_Rotate ($gPicture;90)
                                        
   : ($lOrientation=3)  //Upside down, so rotate 180˚
      $gPicture:=Photo_Rotate ($gPicture;180)
                                        
   : ($lOrientation=6)  //Right 90˚, so need to rotate 270˚
      $gPicture:=Photo_Rotate ($gPicture;270)
                                        
   Else   //The other orientations are not supported. They involved flipping 
the image. Ever occur?
                                                                                
End case 


The Photo_Rotate method is as follows:

  //This method rotates a picture. While it will rotate the picture to
  //any angle, this method is really expecting it to rotate 90˚, 180˚,
  //or 270˚.

C_PICTURE($1;$gPicture)
C_REAL($2;$rDegrees)  //Expects 90, 180, or 270
C_PICTURE($0)

$gPicture:=$1
$rDegrees:=$2

C_LONGINT($lWidth;$lHeight)
C_TEXT($svgRef;$imageRef)

PICTURE PROPERTIES($gPicture;$lWidth;$lHeight)
$svgRef:=SVG_New ($lWidth;$lHeight)
$imageRef:=SVG_New_embedded_image ($svgRef;$gPicture;0;0;".jpeg")

If (($rDegrees=90) | ($rDegrees=270))
        SVG_SET_TRANSFORM_ROTATE ($imageRef;$rDegrees;($lHeight/2);($lWidth/2))
        SVG_SET_TRANSFORM_TRANSLATE 
($imageRef;(($lHeight-$lWidth)/2);(($lWidth-$lHeight)/2))
        DOM SET XML 
ATTRIBUTE($svgRef;"height";String($lWidth);"width";String($lHeight))
Else   //180
        SVG_SET_TRANSFORM_ROTATE ($imageRef;$rDegrees;($lWidth/2);($lHeight/2))
End if 

$0:=SVG_Export_to_picture ($svgRef)
SVG_CLEAR ($svgRef)

HTH.

--
Cannon.Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236
<[email protected]>
<www.synergyfarmsolutions.com>


> On Apr 30, 2018, at 11:03 AM, Douglas Cryer via 4D_Tech 
> <[email protected]> wrote:
> 
> What I want to do is load the picture based on its file property dimensions 
> and not the EXIF property dimansions.  Is there anyway to do this in 4D code? 
>  I hope I have explained the issue correctly...

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to