Author Topic: Export Layout - included images files  (Read 11821 times)

PPPanimal

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: Export Layout - included images files
« Reply #15 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
« Last Edit: July 03, 2007, 12:51:22 PM by PPPanimal »

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Export Layout - included images files
« Reply #16 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.


Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Export Layout - included images files
« Reply #17 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.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Export Layout - included images files
« Reply #18 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.

PPPanimal

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: Export Layout - included images files
« Reply #19 on: July 03, 2007, 08:51:54 PM »
Sweet man, i will give this a try and report back.  Thanks.

PPPanimal

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: Export Layout - included images files
« Reply #20 on: July 04, 2007, 02:44:41 PM »
when do you plan your next update containing this fix?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Export Layout - included images files
« Reply #21 on: July 05, 2007, 01:03:51 AM »
ASAP.  By this weekend, if all goes well.

PPPanimal

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: Export Layout - included images files
« Reply #22 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.

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Export Layout - included images files
« Reply #23 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....

PPPanimal

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: Export Layout - included images files
« Reply #24 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?

Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Export Layout - included images files
« Reply #25 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?

PPPanimal

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: Export Layout - included images files
« Reply #26 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.


Corey Cooper

  • Administrator
  • Hero Member
  • *****
  • Posts: 6216
    • View Profile
Re: Export Layout - included images files
« Reply #27 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".

PPPanimal

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
Re: Export Layout - included images files
« Reply #28 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.