Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Questions and Answers >> Display a local / remote image in a note
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1445507906

Message started by B.Moreira on Oct 22nd, 2015, 5:58am

Title: Display a local / remote image in a note
Post by B.Moreira on Oct 22nd, 2015, 5:58am

Dear all,
been trying to work with images, but had no luck yet doing this (don't know if it's possible).

I wanted to insert some heavy images in the TBX document (+- 2/3MB image, like, 100 images  :D )

I can drag them but it would be overkill for the file. I can link them in the $URL of $File but that would be just that a link.

Is the best of both worlds possible? Like storing the remote/local path to the image in the $URL/$File and making the note display the linked image im map view (displayexpression?) is this possible at this time? It would be great!

If not possible ... any viable alternative for this?

Thanks.

Title: Re: Display a local / remote image in a note
Post by Mark Anderson on Oct 22nd, 2015, 7:24am

This idea has been raised before - displaying linked images files (if only to avoid TBX file size bloat). However, as things stand the main method is drag-drop, into note $Text or onto map backgrounds. I suspect my aTbRef notes are a little out of date - it's difficult as this are changes over time and isn't heavily documented.

Not tried, but you could use an image as a custom $Fill though the image needs to be in the app support's 'fill' sub-folder to work plus you may need to re-size.

If you add 100 x 3MB image to your TBX it will grow a fair amount in size.  If you add all those images to one map as image adornments I suspect TB may wheeze a bit moving the map as you've 300MB of picture data added to the mix. I'm not saying don't do it, but just be aware you're pushing the (likely) design envelope a bit.

Title: Re: Display a local / remote image in a note
Post by B.Moreira on Oct 23rd, 2015, 4:42am

Thank you Mark! I can work with the $Fill. I did the following:

1) in my project folder, I created a sub-folder to hold the originals of the images that will appear in TBX as note fills - for ex. "proj_001";

2) placed some images on it "img_01, img_02 ...";

2) in the TBX application support / Fill directory, I created a symlink to the originals folder;

3) in the TBX file, in the note's $Fill, I can insert "proj_001/img_01" and the image will appear! (need to be careful with resizing / proportions as you have said).

In this way, I can:

have all the images outside TBX support file folder;
have all the images inside a dedicated sub-folder inside my main folder of the project I am working on;
have the images organized by project, having as many projects as I want;
have TBX display these images without the bloat in the TBX file (altough not a problem for BBEdit ;) )

Now if only I could find a way to force proportionality in the fill!
Thanks!


Title: Re: Display a local / remote image in a note
Post by B.Moreira on Jun 8th, 2016, 7:22am

And now I think I did something to that proportionality!

by applying a $Rule like this:


Code:
$Width=runCommand("sips -g pixelWidth partial_path_to_file" + $Fill + ".jpg").substr(-4);
$Width=$Width/$Factor;
$Height=runCommand("sips -g pixelHeight partial_path_to_file" + $Fill +".jpg").substr(-4);
$Height =$Height/$Factor;


the note, when selected, uses a terminal command to determine the $Fill image's width and height, applies a $Factor (which is a Key Attribute of the note) to divide those dimensions, and applies the result to the note's $Width and $Height!

Result: I now only need to give Tinderbox the path to the $Fill, and the note will automatically adjust it's width and height, becoming proportional, allowing for fine tuning via the $Factor key attribute.

So far my experience with Tinderbox can be resumed into this:
:D ;D :o :o ;D :D >:( :o :D :D ;D :D

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.