image queries

Viewing 9 reply threads
  • Author
    Posts
  • February 12, 2021 at 10:18 AM #43432

    Gabrielle Stanley
    Participant

    I have two questions about images.

    Firstly, is there any way to find records that do not have images? I want to see where I need to add images in a 2000+ record form (sewing patterns, and yes I have a lot!), and scrolling through is a bit hit-and-miss, and I would have to write down IDs then go back to them. It would be easier if I could see the list all in one sequence, or filter for them in some way. (I see the image fields are not included in the search rules dropdown in the filter.)

    Secondly, a large proportion of the records I have already put images on have small thumbnails when I display in Photo Grid view, is there any way to reset thumbnail size globally, as clicking on them individually and resetting the thumbnail is very long winded. If I want to look through a subset of patterns to choose one or more to make up, I would like to use the Photo Grid, but with small thumbnails this is not really practical. I tried using the Fields view and Resizing All Photos, but this does not seem to affect the thumbnails.

    I have tried searching but nothing immediately seems to have these specific questions answered.

    Attached screenshot showing how having the small thumbnails and the occasional missing image is rather confusing to look at!

    TIA

    Gabrielle

    Attachments:
    You must be logged in to view attached files.
    February 12, 2021 at 11:25 AM #43434

    Daniel Leu
    Participant

    Have a look at https://www.tapforms.com/forums/topic/attachment-exists-script/#post-40640 for the check if there are images.

    February 13, 2021 at 10:15 AM #43438

    Gabrielle Stanley
    Participant

    Daniel, thanks for your reply. I’m grateful that you took the trouble.

    I feel that writing scripts for this one-off need is perhaps more effort than it is worth, it would probably take me longer than manually going through all the records. Once I have finished processing the migrated data I will not be entering a record without an image, so I would not use the script again. However it is good to know that this is an option if something like this comes up in the future for something that might need to be checked multiple times.

    The thumbnails issue is more of an ongoing problem, as I do not know why images sometimes have a full size thumbnail, and sometimes have a small one, and this could therefore recur, and i wouldn’t want to have to check and resize the image on every record I add – and it takes about 30 seconds per image which feels like a long time when you are just wanting to move on to the next one needing to be resized.

    Gabrielle

    February 13, 2021 at 12:49 PM #43440

    Daniel Leu
    Participant

    I have no idea regarding the different sized thumbnails. That’s something for Brendan to answer.

    Brendan already provided the entire script. The only change you need to make is updating the field id var attachments_field_id = 'fld-......';. Create a field of type script. Open the script, paste Brendan’s code, select the picture field on the left, click on ID and use the fld-xxx value in the script fragment. That’s it. It took me longer to write this than it will you to create it :)

    February 13, 2021 at 3:01 PM #43442

    Brendan
    Keymaster

    Yup, this is all you need:

    function hasAttachments() {
       var attachments_field_id = 'fld-......';
       var attachments = record.getFieldValue(attachments_field_id);
       if (attachments.length > 0) {
          return "YES";
       } else {
          return "NO";
       }
    }
    
    hasAttachments();

    Just replace ‘fld-…..’ with your own Photo field’s ID which you can get on the Fields tab when you select your Photo field.

    As for the thumbnail size, if you switch to the Single Column List View and you have your Photo field as the very first field of your form, Tap Forms will generate thumbnails for you. You can control the size of the thumbnail on the field properties panel for your Photo field.

    But since you’re using the Photo Grid View, that uses the scaling slider there to generate the right size thumbnails. I’m not sure why some are small and some are large for you. I’d have to examine your database to see why that might be the case.

    February 13, 2021 at 5:27 PM #43443

    Sam Moffatt
    Participant

    Aspect ratios of images will skew the thumbnails to be smaller or different proportions. I don’t think there is any extreme cropping that you do on the thumbnails when the aspect ratios are too far out of spec (e.g. excessively tall or wide images). The other problem is if the image has white space around the image will skew the thumbnail appearance as well.

    February 13, 2021 at 11:53 PM #43444

    Gabrielle Stanley
    Participant

    I am ensuring my images are as close to square as possible, some have a wider or taller aspect ratio but I am editing them to reduce this as much as possible. I’m also editing the images to reduce white space also.

    When I display the Form pane, in Fields view, when I have the image field selected, bottom there is Thumbnail size selection. If I select a record with a ‘small’ thumbnail and click on the ‘medium’ selection, it resizes the thumbnail image to pretty much fill the available space in the Photo Grid. I will attach a ‘before’ and ‘after’ screenshot showing how the thumbnail content is at first not really discernable, then when larger I can see the image OK.

    It seems like editing a record (not necessarily changing the image at all) can trigger the display of a small thumbnail. But there are times when it seems like the system changes the thumbnail size without me having done anything, for example yesterday I was scrolling through and a whole section of my records showed small thumbnails, but after quitting yesterday and restarting today, the thumbnails were ‘suddenly’ larger.

    I am at a loss to understand what is going on.

    Attachments:
    You must be logged in to view attached files.
    February 14, 2021 at 11:12 AM #43453

    Gabrielle Stanley
    Participant

    How can I give you access to examine the database?

    I’m coming more to the conclusion that it is related to updating the record that triggers making the thumbnails tiny. At the moment I’m doing a lot of updating because I’m taking advantage of transferring my data from my old Access database to reorganise/rationalise the structure and storage of the associated data. I have just completed a pass of making a particular change, and I think the records affected are ones that I made changes to.

    I will be closing the system soon, so I can see whether they are larger again when I open it again tomorrow morning.

    February 14, 2021 at 5:57 PM #43455

    Sam Moffatt
    Participant

    It feels like the smaller thumbnail used in the link to form field style view is being used rather than the larger sized one that I’d expect for it.

    February 15, 2021 at 2:01 AM #43461

    Brendan
    Keymaster

    Gabrielle, if you send me a backup of your document to support@tapforms.com I can look into it for you.

Viewing 9 reply threads

You must be logged in to reply to this topic.