Discussions

Expand all | Collapse all

Displaying images on reports

  • 1.  Displaying images on reports

    Posted 29 days ago
    Hello all,
    I have a question regarding getting images to display on reports. I am currently trying to get images that are uploaded to quickbase to also display in reports as regular images. However, I am having difficulty getting the code to properly work.

    -----

    I've found that the code works if I code the field such that a specific image address is hard coded into the rich text field, I can get an image to display, but since it's hard coded to a specific image, all the rows display the single image that was hard coded.

    What I really want is for the code in the "Photo" field to dynamically look at that record's "Photo File" address and display the image connected to that record's photo file.

    This is the code that I currently have in the Formula - Rich Text code for the "Photo" field:
    "<img src=https://xxxxxxxxx-####.quickbase.com/up/xxxxxxxxxx/g/rc/ej/va/"&Right([Photo File],"va/")
    I did notice that the > symbol is missing, but the only place that quickbase will allow it is at the end of va/, which just cases it to behave like the example lines of code below. Additionally, when I try to put it on the end like in the second example line of code that I've shown below, quickbase returns a syntax error.

    This is the code that works when I hard code a specific image:
    "<img src=https://xxxxxxxxx-####.quickbase.com/up/xxxxxxxxxx/g/rc/ej/va/IMG_2294.jpg"&"height=100>"
    Note: if I were to also hard code the following line of code, I can get the same behavior:
    "<img src=https://xxxxxxxxx-####.quickbase.com/up/xxxxxxxxxx/g/rc/ej/va>"

    Note: I've removed some private identifying information from the code.

    What should I be doing to get the images to display properly? Thank for you help and suggestions.

    ------

    I have also included a screenshot of the what I'm hoping to achieve from this report:



    ------------------------------
    Andrew Le
    ------------------------------


  • 2.  RE: Displaying images on reports

    Posted 29 days ago
    try this

    "<img src=" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e7/v0" & "\" width=\"50\">"

    in the above example the image is stored on field ID 7.  Play with either the width parameter or replace with a height parameter (but not both)

    This probably will work too, with less syntax

    "<img src=" & URLRoot() & "up/" & Dbid() & "/a/r" & [Record ID#] & "/e7/v0 width=50>"

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------



  • 3.  RE: Displaying images on reports

    Posted 29 days ago
    That works perfectly, thanks for the help!

    I do have a second (and hopefully last for this topic thread) question though, my pictures that are normally in portrait orientation are being turned over on their sides into landscape orientation. Is there anything I can do to ensure that picture maintain their correct orientation?

    ------------------------------
    Andrew Le
    ------------------------------



  • 4.  RE: Displaying images on reports

    Posted 29 days ago
    Alas, I think that question has been asked on the forum before with no answer at present.  I think that users would hoping that Quick Base would be able to look at the data stored with the picture and read and correct for orientation.  There may be a User Voice suggestion about that.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------



  • 5.  RE: Displaying images on reports

    Posted 28 days ago
    I can't recreate the orientation problem. I uploaded one image in both portrait and landscape orientations and they are shown as expected:

    Do you have more details about the pictures; i.e. file format, size, etc...?


    ------------------------------
    Adam Keever
    ------------------------------



  • 6.  RE: Displaying images on reports

    Posted 28 days ago
    Sure,

    The photos were taken on an iOS device and imported into windows as typical HEIC files, they were then converted into jpg's using heictojpg.com

    They are imported into quickbase as jpg's, as either 3024x4032 or 4032x3024 depending on the orientation. The images range anywhere between 0.5 MB to 1.5 MB

    ------------------------------
    Andrew Le
    ------------------------------



  • 7.  RE: Displaying images on reports

    Posted 28 days ago
    Can you shrink the size down before import? I am wondering if there is a size limitation that is forcing the images to landscape. The file I tested was only 584 x 198.

    ------------------------------
    Adam Keever
    ------------------------------



  • 8.  RE: Displaying images on reports

    Posted 28 days ago
    I don't think that is the issue. I enlarged the photo to 7008 x 2376 and 2376 x 7008 and it imported and shows as expected. This is puzzling...

    ------------------------------
    Adam Keever
    ------------------------------



  • 9.  RE: Displaying images on reports

    Posted 28 days ago
    Edited by Adam Keever 28 days ago
    Could not recreate the issue by importing on mobile or desktop. Have you tried to put in a support ticket?

    ------------------------------
    Adam Keever
    ------------------------------



  • 10.  RE: Displaying images on reports

    Posted 28 days ago
    Desktop

    hmmm, I've resized the image, from 3024x4032 to 605x807 (20% of original). The file size has gone down from 1.2 MB to 0.8 MB, and it's still a jpg.

    It now orients correctly by itself.


    ------------------------------
    Andrew Le
    ------------------------------



  • 11.  RE: Displaying images on reports

    Posted 28 days ago
    That's good news.

    ------------------------------
    Adam Keever
    ------------------------------



  • 12.  RE: Displaying images on reports

    Posted 28 days ago
    Are you actually saying that if the file size is small enough the pictures will orient properly?

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    markshnier2@gmail.com
    ------------------------------



  • 13.  RE: Displaying images on reports

    Posted 28 days ago
    I started with a small file and resized it larger and it imported and showed correctly for both landscape and portrait orientations, but it sounds like when Andrew imported large files the orientation was not correct and after reducing the size the orientation was correct.

    ------------------------------
    Adam Keever
    ------------------------------



  • 14.  RE: Displaying images on reports

    Posted 28 days ago
    I've just tested the following:

    A: Large picture with a large file size, pulled straight off google images (as a jpg): self orients correctly
    B: Large picture with a large file size, freshly converted from HEIC to jpg: does not self orient correctly
    C: Continuing from Case B, resizing the image down to a smaller picture and smaller file size (no changes in file type, jpg to jpg): self orients correctly

    Based on this, it seems like quickbase doesn't like whatever is happening to an image when the image is freshly converted from HEIC to jpg.
    And whatever is happening when the image is resized from a large everything to a smaller everything, all keeping with jpg, seems to fix it.

    ------------------------------
    Andrew Le
    ------------------------------



  • 15.  RE: Displaying images on reports

    Posted 28 days ago
    Good to know. That should help developers craft a fix.

    ------------------------------
    Adam Keever
    ------------------------------