The Tournament Director Forums

Main => Suggestions => Topic started by: amcq10 on June 28, 2007, 06:06:34 PM

Title: Export Layout - included images files
Post by: amcq10 on June 28, 2007, 06:06:34 PM
Corey -

While trying to export my Layout Template, I get the message seen in the image attachment.

Your notes state that as long as the images are within the Tournament Director folder (or sub-folders) that they should be fine.
However, in this case, it states that it will not include the images, even though there are inside the TD subfolders.

Not sure why it's not seeing the location of these files properly.
Am I not doing something right?, or can I provide any further details to help resolve this?

Title: Re: Export Layout - included images files
Post by: amcq10 on June 28, 2007, 06:11:22 PM
Also, If I hit "OK" to bypass those image files... I can't get past the saving of the Layout Template.

no matter what filename I give it... it always gives me an error about "selecing a path relative to the Tournament Director folder". as seen in the attached image.

Title: Re: Export Layout - included images files
Post by: Corey Cooper on June 28, 2007, 09:29:46 PM
Press V while holding CTRL, ALT, and SHIFT and the TD will give you a system information dump.  Copy that info and paste it in a reply.
Title: Re: Export Layout - included images files
Post by: PPPanimal on June 29, 2007, 12:26:12 AM
same problem here too corey.
the files it lists as having a invalid path are all in the same path as the system dumps shows as TD's home.
also, when i try to use <TDFolder> as the path to the images in the cell i lose the picture and get a box instead.
when i try to use <tdfolder> in a CONFIG FILES path, i get invalid path error.

Browser: Microsoft Internet Explorer
Browser Code Name: Mozilla
Browser Language: en-us
Browser Minor Version: ;SP2;
Browser Version: 4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
Cookies Enabled: true
CPU Class: x86
Date: 1:20:43 am 6/29/2007
DB File: D:\Games\The Tournament Director 2\db/td.db
DB Folder: D:\Games\The Tournament Director 2\db
Home: d:\Games\The Tournament Director 2
JScript Build: 8831
JScript Version: 5.6
Media Player Version: 10.0.0.4036
Online: true
Platform: Win32
System Language: en-us
TD Version: 2.3.3
User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
User Language: en-us

Title: Re: Export Layout - included images files
Post by: amcq10 on June 29, 2007, 12:57:28 AM
And here's the info from my computer..

Browser: Microsoft Internet Explorer
Browser Code Name: Mozilla
Browser Language: en-us
Browser Minor Version: ;SP2;
Browser Version: 4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
Cookies Enabled: true
CPU Class: x86
Date: 10:56:00 pm 6/28/2007
DB File: D:\Program Files\The Tournament Director 2\db/td.db
DB Folder: D:\Program Files\The Tournament Director 2\db
Home: d:\Program Files\The Tournament Director 2
JScript Build: 8831
JScript Version: 5.6
Media Player Version: 11.0.5705.5043
Online: true
Platform: Win32
System Language: en-us
TD Version: 2.3.3
User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
User Language: en-us




Title: Re: Export Layout - included images files
Post by: Corey Cooper on June 29, 2007, 09:46:01 AM
That's what I thought.  The function that determines if a path is relative or absolute is case-sensitive, and it shouldn't be.  The fact that the "Home" path starts with a lower-case 'd' is throwing it off.  This will be fixed in the next release (today, hopefully).
Title: Re: Export Layout - included images files
Post by: PPPanimal on June 30, 2007, 02:17:29 AM
Hi Corey.

The export feature seams to work fine now.

However, when i insert an image into a cell it makes the path relative but the image does not show.  Just the box.
I tried using a different folder than the images folder as another message suggests, but still, i only get a box.

<img src="graphics\crabby.bmp" border="0">

Also, i can't seam to get relative paths to work for chips, sounds or even the ConfigFile path names.

should <tdfolder> work?  or %tdfolder%
whats the proper syntax for using relative paths with these files?

I am tring to send a layout to the head of the Pirana Poker Tour.
I am sure his path and most of the Tournament Directors paths are going to be different from mine.
I need a easy way to send this around to all the different Directors and have it easy for them to install it
without having to teach them all how to change the path names to all the images, sounds etc.

I was supposed to send this to him already but was hoping to hold out till this feature was working.
Is this any other way to make this easy for them to install without getting them all to reinstall TD to the
same folder?
Title: Re: Export Layout - included images files
Post by: Corey Cooper on July 01, 2007, 10:10:46 AM
Relative paths are the preferred way to reference images, and should work just fine.  So, your example of:

<img src="graphics\crabby.bmp" border="0">

.. looks fine to me, I don't know why it wouldn't work, especially if you used the "Insert Image" button to insert the <img> tag, because that would imply the program was able to see that the file was relative, and inserted the <img> tag using a relative path.

As a matter of fact, the only "relative" paths that wouldn't work are paths to images in the "images" folder.  If you inserted an image that was in that folder (using the "Insert Images" button), it would use a full path, like "C:\Prorgam Files\The Tournament Director 2\images\pic.jpg".  Otherwise, you would see broken images as you describe.  However, with version 2.3.3, that has also been fixed.  But this "fix" wasn't a code fix, it was done by moving where the TD stores its internally packaged image files, so there wouldn't be a conflict with where a user might reference their images from.  So I suspect you are seeing some other type of issue.

When you reference an image "relatively", that just means you should start the path to the image starting at the TD folder, instead of starting it at C:\.  So for a file "C:\Program Files\The Tournament Director 2\graphics\crabby.bmp", the relative path would be "graphics\crabby.bmp".  %tdfolder% isn't a set variable, so it wouldn't work, and <TDFolder> is used when displaying some paths (just to shorten the length within the user interface).

If you like, you can export your layout and send it to me, and I'll see if I get the same broken images as you are seeing...
Title: Re: Export Layout - included images files
Post by: PPPanimal on July 01, 2007, 10:47:34 AM
Hmmm, ok.  Well i used the insert image button and it does show a relative path but just a box appears.  odd.

Here is the layout.  Check out the Logo2 cell.  It has a full path to the image once, then a relative path to it again.
Only one Logo appears.


Title: Re: Export Layout - included images files
Post by: Corey Cooper on July 01, 2007, 03:23:35 PM
When I viewed your layout, the "Logo1" cell showed a broken image.  That's because the path to the image is a full (or absolute) path, not a relative path:

Code: [Select]
<img src="D:\Games\The Tournament Director 2\images\Pirana_banner.bmp" border="0">
My TD is no installed in "D:\Games", so this breaks.  I changed it to:

Code: [Select]
<img src="images\Pirana_banner.bmp" border="0">
... and it works.  In the Logo2 cell, the HTML is:

Code: [Select]
<img src="d:\Games\The Tournament Director 2\graphics\crabby.bmp" border="0">

<img src="graphics\crabby.bmp" border="0">

... and what *I* see is a broken image on the left, and a visible image on the right.  So, the image using a full path is broken (is it should be, since my TD isn't on my D: drive) and the image using a relative path is visible.

Are you seeing something different?
Title: Re: Export Layout - included images files
Post by: PPPanimal on July 01, 2007, 05:47:00 PM
Ya, i see the broken image on the right, from the relative path.
The full path image is the only one i see.
Odd when i used the insert image button to create the relative path image.

i wondered it maybe TD was confused on where TD is really installed since i had
installed it on C:, then a diff folder on C: and finally on the D: drive.
i have since uninstalled the other copies of it and only have the D: copy installed.
The last install was made on D:  A few times infact, overwriting the older versions
with the newer betas.

And as you saw, the control V data output did show TD as seeing itself on Drive D:
I can't figure out how it can make a relative path suggesting that it knows its in the TD
folder etc yet can't load that file when the layout it loaded.  Odd.
Title: Re: Export Layout - included images files
Post by: PPPanimal on July 03, 2007, 10:58:44 AM
Well i again uninstalled all versions/copies of TD and then rebooted my computer.
Then reinstalled a fresh copy of the newest version of TD and still, i can't
link images using the insert image button.  This time TD is on the C drive
and in the program files folder.  I thought maybe being on D may have been the
problem.  It makes a relative path but only shows a box.  I tested it on both my
layout and on a default layout the was included with TD.  Dam i wish i knew what
was going on here.
Title: Re: Export Layout - included images files
Post by: Corey Cooper on July 03, 2007, 11:50:03 AM
Wish I knew what was going on, too.

The TD determines where it is "located" at run time.  That means it doesn't store its "installed location" anywhere - it derives each time you run the software.  The installer *does* remember where it was last installed - that's why when you install a new version when you already have an existing version installed it will attempt to install it to the same location as the existing version.

It could have something to do with running on a different drive (different than C:), but I don't see why.  I'll try that later.

Title: Re: Export Layout - included images files
Post by: PPPanimal on July 03, 2007, 12:13:40 PM
Well i tested this again on another computer that also had TD installed on it before.
Tried an older version of TD then upgraded to the new version and still just a box shows.
I am going to test this on a third computer that has never had TD on it before and see
what happens.  I will report results soon.
Title: Re: Export Layout - included images files
Post by: PPPanimal on July 03, 2007, 12:30:44 PM
Just finished installing a fresh newest copy of TD on a system that never had TD on it before and its still not working.
Its making relative paths but only showing a box.  This is using a default tournament that comes with TD and linking to
a default image from TD.  Tried one from the images folder and one from a new folder i copied the images into.
Still just boxes.  The new folder i created was located inside the TD folder.  Does it need to be inside the images folder
or something?  Is it just me doing something wrong or is there really a bug here?  Odd.

I am not a stupid person but this is really making me feel dumb.  lol.  How can this work for you and not for me on 3
differrent computers.
Title: Re: Export Layout - included images files
Post by: PPPanimal on July 03, 2007, 12:43:50 PM
I just tried sticking the image file in about every spot i can think of to see if TD would find it.
had one in the root of C, graphics folder on C, graphics folder in program files, then graphics
folder in TD and finally a graphics folder in the TD images folder.

Not sure where TD is looking when it is following the relative path but
it still shows a box.  lol.

When i link to any folders in TD i get a relative path, when linking outside of TD (c:\graphics) i get a full path.
I know this is normal, just thought i would mention it.

This is my lastest info dump.

Browser: Microsoft Internet Explorer
Browser Code Name: Mozilla
Browser Language: en-us
Browser Minor Version: ;SP2;
Browser Version: 4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
Cookies Enabled: true
CPU Class: x86
Date: 1:46:57 pm 7/3/2007
DB File: C:\Program Files\The Tournament Director 2\db/td.db
DB Folder: C:\Program Files\The Tournament Director 2\db
Home: C:\Program Files\The Tournament Director 2
JScript Build: 8831
JScript Version: 5.6
Media Player Version: 10.0.0.4036
Online: true
Platform: Win32
System Language: en-us
TD Version: 2.3.4
User Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 1.1.4322)
User Language: en-us


is the forward slash in this line normal?                        VV

DB File: C:\Program Files\The Tournament Director 2\db/td.db
Title: Re: Export Layout - included images files
Post by: Corey Cooper on July 03, 2007, 01:47:32 PM
It's technically not the TD that is looking for the image (when displaying it on the Tournament clock page), it's Internet Explorer.  So it comes down to what Internet Explorer thinks is its "current directory".  The TD gleans this information from Internet Explorer, so they should be the same, but according to what you are seeing, it would appear that it is not.  Don't know why, that's why I need to try a few things (like running from a different drive).

In this context, forward slashes (/) and backslashes (\) are interchangeable.  IE just doesn't care which you use.

Title: Re: Export Layout - included images files
Post by: Corey Cooper on July 03, 2007, 07:11:59 PM
OK, I was able to reproduce it.  I'll get back with details when I figure this out.
Title: Re: Export Layout - included images files
Post by: Corey Cooper on July 03, 2007, 08:24:56 PM
Ugh, this turns out to be one of those [few] things that behaves differently in a development environment.  Frankly, I can't see how using relative paths has ever worked, but I can't see why it hasn't come up until now.  Either way, I could find no way to make IE understand a relative path when running in an "installed" mode (versus my development mode).

To solve this, I have created a <home> token (<tdfolder> is synonymous).  This will expand to the full path of where your TD is installed.  So basically, all images should be referenced with a full (absolute) path, but I've added code to allow you to specify it relatively, and the TD fills in the path for you.

If you insert an image with the "Insert Image" button (for example one of the built-in chip images), it used to insert:

Code: [Select]
<img src="images\chip_red.gif" border="0">
It will now insert:

Code: [Select]
<img src="file:///<home>\images\chip_red.gif" border="0">
When displayed on the Tournament page, it will automatically be expanded to:

Code: [Select]
<img src="file:///C:\Program Files\The Tournament Director 2\images\chip_red.gif" border="0">
(or wherever you have the TD installed).  The "file:///" is inserted by IE automatically if omitted, but I chose to go ahead and insert it just to be sure.  Hopefully this will clear this issue up.
Title: Re: Export Layout - included images files
Post by: PPPanimal on July 03, 2007, 08:51:54 PM
Sweet man, i will give this a try and report back.  Thanks.
Title: Re: Export Layout - included images files
Post by: PPPanimal on July 04, 2007, 02:44:41 PM
when do you plan your next update containing this fix?
Title: Re: Export Layout - included images files
Post by: Corey Cooper on July 05, 2007, 01:03:51 AM
ASAP.  By this weekend, if all goes well.
Title: Re: Export Layout - included images files
Post by: PPPanimal on July 09, 2007, 02:36:08 AM
All is working fine here now with the new update.  Thanks.
I see we can even make relative links to files in the IMAGE folder now.
This is better than needing a GRAPHICS or some other named folder
for files we want to link with a relative path.  Great work man.
Title: Re: Export Layout - included images files
Post by: Corey Cooper on July 09, 2007, 09:53:10 AM
Glad to hear it is working properly.  This is always good to know, but especially in a situation such as this one where the application behaves differently in my development setting....
Title: Re: Export Layout - included images files
Post by: PPPanimal on July 09, 2007, 12:55:16 PM
Darn, one more prob with relative paths.

ATM, sounds and images seam to work fine but i can't seam to get relative paths working for chips.
Is it just me or is this not working yet?
Title: Re: Export Layout - included images files
Post by: Corey Cooper on July 09, 2007, 03:46:21 PM
No, it should work.  As a matter of fact, if that one didn't work, I would have heard about it long ago, since the included chip images are located in the "images" folder.  Therefore, it has to use absolute paths (or, it HAD to), or else the chip images would have been broken.

When you specify an image for a chip, you can enter the path yourself, or use the Browse... feature to find it.  Either way, the TD converts it to a relative path, if possible, so that your chips templates are portable.  However, when it inserts a chip image on the screen, it always uses an absolute path.

This is relating to using the <chips> token to display your chips on the Tournament page.  That IS what you were referring to, right?
Title: Re: Export Layout - included images files
Post by: PPPanimal on July 09, 2007, 05:20:24 PM
Yes, i think we are talking about the same thing.  But when i use browse to find a image for a chip, it inserts a absolute path.
The images i am using are in the IMAGES folder in TD. 
If i type in a relative path to the image, i get an error about invalid path.
Here is a screen shot.

Title: Re: Export Layout - included images files
Post by: Corey Cooper on July 10, 2007, 10:28:09 AM
Omit <TDFolder>\ when specifying the path in those dialogs.  I know, somewhat inconsistent...

Your screenshot is pretty small, but I think you're trying to reference "<TDFolder>\images\chip_black.gif".  If your TD is installed in the default location, or "C:\Program Files\The Tournament Director 2", you can enter either of the following:

images\chip_black.gif

or

C:\Program Files\The Tournament Director 2\images\chip_black.gif

Either way will work, and internally the TD will store "images\chip_black.gif" no matter which you choose, because it recognizes that the path is relative to the TD folder.  This way, if you load the same chips template on a computer on which the TD is installed on D:\TD2, the chip image will still be referenced properly.

When the chips are rendered on the screen, it automatically expands the paths to absolute paths so the chip images should never "break".
Title: Re: Export Layout - included images files
Post by: PPPanimal on July 10, 2007, 05:01:26 PM
ah, ok man, thanks.

So
C:\program files\TD2\images\chip.jpg
is stored as
images\chip.jpg
and expanded to
d:\td2\images\chip.jpg
if his TD is stored on the D drive.

I will give this a try and report back.