Is there a way to force all photo file attachments to display vertically?

  • 1
  • 2
  • Question
  • Updated 8 months ago
  • Answered
Title says it all.

Currently I have users uploading photos off their phones but im running into an issue where some of the photos are displaying horizontally.

Is there an easy way to either force all photos to display vertically or letting users set the orientation of the photo?

My current Richtext formula field is as follows:

"<div><img src=\""&URLRoot()&"up/"& Dbid() & "/a/r"& [Record ID] 
&"/exx/v0\" height=400;width=400;></div>"

I did foolishly tried rotate=90; but...yea thats not a thing haha
Photo of Giuseppe macri

Giuseppe macri

  • 544 Points 500 badge 2x thumb

Posted 8 months ago

  • 1
  • 2
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,694 Points 20k badge 2x thumb
transform is a thing:

style='transform: rotate(90deg);'
Photo of Giuseppe macri

Giuseppe macri

  • 544 Points 500 badge 2x thumb
would i just append that to the end of the width portion of the code?

I barely pass as a script kiddie so if this seems overly simple i apologize.

Edit#2: If you could make a button that would rotate the photo, how would you go about doing it?
(Edited)
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,694 Points 20k badge 2x thumb
Adjust your formula to produce this HTML for the image:

<img src='...' height='400' width='400' style='transform: rotate(90deg);'>

FWIW, all those "backslash double quote"s (ie \") are just making your formula hard to read. You can just use a single quote instead (ie ').

Or if there are no spaces in the attribute value you don't even need any quotes at all:

<img src=https://www.gravatar.com/avatar/30d923ee56cbae00df6ad2921abac67b?d=identicon&s=100 height=400 width=400 style=transform:rotate(90deg)>
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 27,694 Points 20k badge 2x thumb
BTW, you are better off rotating the image before importing it to QuickBase as some images will need rotation and other don't. This can be done using script.
Photo of Giuseppe macri

Giuseppe macri

  • 544 Points 500 badge 2x thumb
Worked like a charm. Thanks for the advice.

Edit: For those curious, to make the button, you would need to create two fields, 

1 for Degree of Rotation (Numeric) and a Formula URL field. Youd put the Degree of Rotation field right before the "deg" innto the formula above. 

Then the button would just add 90 to the Degree of Rotation field (this would be a URL formula field)
(Edited)