# icons

**URL:** <https://forum.vassalengine.org/t/icons/1469>\
**Category:** Development\
**Created:** [January 13, 2009, 7:50pm UTC](https://forum.vassalengine.org/t/icons/1469 "2009-01-13T19:50:46Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)\
**Post date:** [January 20, 2009, 12:59am UTC](https://forum.vassalengine.org/t/icons/1469/21 "2009-01-20T00:59:35Z")

</div>

> [@](#):
>
> How far will SVG support be extended (i.e into module trait componernts)?

Anywhere you can load a png, gif or jpg in 3.0, you can now load an svg image instead.

There has been some discussion of having GamePieceImages generate svg’s, but currently, there are no other plans beyond allowing them to be used in place of existing images.

B.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 20, 2009, 9:13am UTC](https://forum.vassalengine.org/t/icons/1469/22 "2009-01-20T09:13:55Z")

</div>

Thus spake “Brent Easton”:

> [@](#):
>
> > [@](#):
> >
> > I think there could be some threading problems here if you don’t use a  
> > ConcurrentHashMap, BTW. What will happen if two different threads request a
> 
> BufferedImage at the same time?
> 
> Yes, I hadn’t considered threading yet. I will fix.

There’s no threading problem with the methods which return an Icon, BTW,  
as that’s a Swing component and so those methods should only ever be called  
from the EDT anyhow. It’s just the ones which return something else from  
the map.

> [@](#):
>
> > [@](#):
> >
> > That’s actually not what I was suggesting. I don’t like the verbosity  
> > of getInstance(). What I do like is having a single internal object keep  
> > the state, and to have _that_ be a singleton. What I was suggesting is that  
> > the IconFactory class act as a cover for an inner private class. (If that  
> > doesn’t make sense, I’ll show you what I mean in a day or two.)
> 
> Ok, I know what you mean (I think). The getInstance() calls will be internal.

Yes, except that they wouldn’t need to be methods calls at all—you’d just  
have a private static member called instance, and call methods on that.

> [@](#):
>
> Does it need to be an inner private class, or will private instance variable  
> s of IconFactory do? That’s the way I’ve seen it done in other parts of Vassa  
> l.

Well, it doesn’t _need_ to be an inner private class, but there are some  
benefits of having it be one. In particular, it’s nicer to have an inner  
private class if the alternative is having a huge static block for  
initialization—all of that stuff can be put into the ctor of the inner  
private class, then. Also, having an inner private class future-proofs us  
somewhat, as fewer changes need to be made if we decide someday that this  
shouldn’t be a singleton anymore.

–  
J.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 20, 2009, 9:29am UTC](https://forum.vassalengine.org/t/icons/1469/23 "2009-01-20T09:29:41Z")

</div>

Thus spake “Tim M”:

> [@](#):
>
> How far will SVG support be extended (i.e into module trait componernts)?

Right now, we don’t have plans to do more, but our present plans extend  
into only about 3.3 or so. What you’re suggesting here had never occurred  
to me, actually. It’s not a bad idea, but probaby won’t get any attention  
in the next 6-9 months.

–  
J.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)\
**Post date:** [January 20, 2009, 9:50am UTC](https://forum.vassalengine.org/t/icons/1469/24 "2009-01-20T09:50:47Z")

</div>

Joel,

What’s the best way to report a bug if you are in a section of code and realise something has gone wrong, but no Exception has actually been raised. I’d like to raise a Bug dialog with an error message and a stack trace to where I am now in the code.

Ta,  
B.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 20, 2009, 10:00am UTC](https://forum.vassalengine.org/t/icons/1469/25 "2009-01-20T10:00:20Z")

</div>

Thus spake “Brent Easton”:

> [@](#):
>
> Joel,
> 
> What’s the best way to report a bug if you are in a section of code and reali  
> se something has gone wrong, but no Exception has actually been raised. I’d l  
> ike to raise a Bug dialog with an error message and a stack trace to where I  
> am now in the code.
> 
> Ta,  
> B.

I would create an exception to throw, and then catch it. This gets you  
your stack trace with the least amount of fuss, I think.

try {  
…  
if (mojo == bad) throw new BadMojoException(e);  
…  
}  
catch (BadMojoException e) {  
ErrorDialog.bug(e);  
}

–  
J.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![tar](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/tar/32/21_2.png) [@tar](https://forum.vassalengine.org/u/tar)\
**Post date:** [January 20, 2009, 5:08pm UTC](https://forum.vassalengine.org/t/icons/1469/26 "2009-01-20T17:08:37Z")

</div>

On Jan 20, 2009, at 2:00 AM, Joel Uckelman wrote:

> [@](#):
>
> Thus spake “Brent Easton”:
> 
> > [@](#):
> >
> > Joel,
> > 
> > What’s the best way to report a bug if you are in a section of code  
> > and reali  
> > se something has gone wrong, but no Exception has actually been  
> > raised. I’d l  
> > ike to raise a Bug dialog with an error message and a stack trace  
> > to where I  
> > am now in the code.
> > 
> > Ta,  
> > B.
> 
> I would create an exception to throw, and then catch it. This gets you  
> your stack trace with the least amount of fuss, I think.

Not that it’s difficult to create this without needing the whole  
exception catching machinery:

new Throwable().printStackTrace();

will print out the current stack trace. This can be wrapped up with a  
StringOutputStream and a dialog in a fairly simple utility method if  
needed, although it does add one additional method call to the stack:

public void showStack() {  
StringWriter s = new StringWriter();  
new Throwable().printStackTrace(s);  
JOptionPane.showMessageDialog(null, s.toString());  
}

> [@](#):
>
> try {  
> …  
> if (mojo == bad) throw new BadMojoException(e);  
> …  
> }  
> catch (BadMojoException e) {  
> ErrorDialog.bug(e);  
> }
> 
> –  
> J.
> 
> * * *
> 
> Messages mailing list  
> [Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
> [forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)\
**Post date:** [January 20, 2009, 9:02pm UTC](https://forum.vassalengine.org/t/icons/1469/27 "2009-01-20T21:02:47Z")

</div>

Joel,

> [@](#):
>
> I would create an exception to throw, and then catch it. This gets you  
> your stack trace with the least amount of fuss, I think.

Thanks.

Next task is to wrap my head around the threading issues. It is not something I have looked into in detail before.

New version in swampwallaby-work@4927 which I think resolves Concurrency and Error Handling issues.

The idea is that the IconFactory scan of the Vassal installation might take a little time, so I fire it off in a background thread to allow the module to continue initializing. However, it is possible a request to getIcon() might come in before the scan has completed and will need to wait for the preload thread to complete.

Once the preload thread is complete, concurrency on the iconFamilies map is no longer an issue. Concurrency is handled when individual icons are needed to be built in the IconFamily class.

Thanks,  
B.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![rk1](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/r/9f8e36/32.png) [@rk1](https://forum.vassalengine.org/u/rk1)\
**Post date:** [January 20, 2009, 9:36pm UTC](https://forum.vassalengine.org/t/icons/1469/28 "2009-01-20T21:36:34Z")

</div>

> [@](#):
>
> What’s the best way to report a bug if you are in a section of code and realise something has gone wrong, but no Exception has actually been raised.

This reminds me of an idea I had the other night. We should add a “Report a Bug” entry to the Help menu! Let people report bugs manually just like the automated bug reporter does, but without having to go to the SourceForge site. We’ll always upload the errorLog of course, so no more hassling people to remember to include the VASSAL version, Java version, OS, module name, etc.

rk

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 20, 2009, 9:39pm UTC](https://forum.vassalengine.org/t/icons/1469/29 "2009-01-20T21:39:01Z")

</div>

Thus spake “Rodney Kinney”:

> [@](#):
>
> This reminds me of an idea I had the other night. We should add a “Report a  
> Bug” entry to the Help menu! Let people report bugs manually just like the  
> automated bug reporter does, but without having to go to the SourceForge  
> site. We’ll always upload the errorLog of course, so no more hassling  
> people to remember to include the VASSAL version, Java version, OS, module  
> name, etc.

That’s been on my list of things to do since I created the Bug Dialog. The  
reason I haven’t done it yet is that the dialog text needs to be different,  
as well as the path through the panes in the dialog.

I think it’s too late to do this for 3.1, since it would require going back  
to the translators again.

–  
J.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![rk1](https://forum.vassalengine.org/letter_avatar_proxy/v4/letter/r/9f8e36/32.png) [@rk1](https://forum.vassalengine.org/u/rk1)\
**Post date:** [January 20, 2009, 9:49pm UTC](https://forum.vassalengine.org/t/icons/1469/30 "2009-01-20T21:49:50Z")

</div>

> [@](#):
>
> I think it’s too late to do this for 3.1, since it would require going back  
> to the translators again.

Yes, let’s not try to fit it into 3.1.

rk

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![Tim\_M](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/tim_m/32/2_2.png) [@Tim\_M](https://forum.vassalengine.org/u/Tim_M)\
**Post date:** [January 20, 2009, 9:50pm UTC](https://forum.vassalengine.org/t/icons/1469/31 "2009-01-20T21:50:52Z")

</div>

Another thing worthwhile in the help menu (or somewhere) would be connected links in module library/module directly to main website and forums for users to find things not bug related perhaps

From: Joel Uckelman [uckelman@nomic.net](mailto:uckelman@nomic.net)  
To: VASSAL Engine Forums Mailing List [messages@forums.vassalengine.org](mailto:messages@forums.vassalengine.org)  
Sent: Tuesday, January 20, 2009 3:38:59 PM  
Subject: Re: [Developers]icons

Thus spake “Rodney Kinney”:

> [@](#):
>
> This reminds me of an idea I had the other night. We should add a “Report a  
> Bug” entry to the Help menu! Let people report bugs manually just like the  
> automated bug reporter does, but without having to go to the SourceForge  
> site. We’ll always upload the errorLog of course, so no more hassling  
> people to remember to include the VASSAL version, Java version, OS, module  
> name, etc.

That’s been on my list of things to do since I created the Bug Dialog. The  
reason I haven’t done it yet is that the dialog text needs to be different,  
as well as the path through the panes in the dialog.

I think it’s too late to do this for 3.1, since it would require going back  
to the translators again.

–  
J.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org) ([Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org))  
[http://forums.vassalengine.org/mailman/listinfo/messages\_forums.vassalengine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)\
**Post date:** [January 24, 2009, 12:38pm UTC](https://forum.vassalengine.org/t/icons/1469/32 "2009-01-24T12:38:53Z")

</div>

Joel,

I have run into a problem displaying icons added to modules via ImageOps.

When I add an icon to Vassal, I can access it using an it OpIcon via the path

/icons/32x32/VASSAL.png

for example, and this works perfectly.

However, when I add the Icon to a module and try and access via the path

icons/32x32/go-top.png

I get a FileNotFoundException trying to access

images/icons/32x32/go-top.png

How do you want to handle this?

Thanks,  
Brent.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 24, 2009, 1:03pm UTC](https://forum.vassalengine.org/t/icons/1469/33 "2009-01-24T13:03:14Z")

</div>

Thus spake “Brent Easton”:

> [@](#):
>
> Joel,
> 
> I have run into a problem displaying icons added to modules via ImageOps.
> 
> When I add an icon to Vassal, I can access it using an it OpIcon via the path
> 
> /icons/32x32/VASSAL.png
> 
> for example, and this works perfectly.
> 
> However, when I add the Icon to a module and try and access via the path
> 
> icons/32x32/go-top.png
> 
> I get a FileNotFoundException trying to access
> 
> images/icons/32x32/go-top.png
> 
> How do you want to handle this?
> 
> Thanks,  
> Brent.

Where are you indending for icons/32x32/go-top.png to be?

–  
J.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)\
**Post date:** [January 24, 2009, 1:07pm UTC](https://forum.vassalengine.org/t/icons/1469/34 "2009-01-24T13:07:50Z")

</div>

for icons to be at the same level as images, as we now have in the Vassal source setup.

B.

\*\*\*\*\*\*\*\*\*\*\* REPLY SEPARATOR \*\*\*\*\*\*\*\*\*\*\*

On 24/01/2009 at 2:03 PM Joel Uckelman wrote:

> [@](#):
>
> Thus spake “Brent Easton”:
> 
> > [@](#):
> >
> > Joel,
> > 
> > I have run into a problem displaying icons added to modules via ImageOps.
> > 
> > When I add an icon to Vassal, I can access it using an it OpIcon via the
> 
> path
> 
> > [@](#):
> >
> > /icons/32x32/VASSAL.png
> > 
> > for example, and this works perfectly.
> > 
> > However, when I add the Icon to a module and try and access via the path
> > 
> > icons/32x32/go-top.png
> > 
> > I get a FileNotFoundException trying to access
> > 
> > images/icons/32x32/go-top.png
> > 
> > How do you want to handle this?
> > 
> > Thanks,  
> > Brent.
> 
> Where are you indending for icons/32x32/go-top.png to be?
> 
> –  
> J.
> 
> * * *
> 
> Messages mailing list  
> [Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
> [forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

* * *

Brent Easton  
Analyst/Programmer  
University of Western Sydney  
Email: [b.easton@exemail.com.au](mailto:b.easton@exemail.com.au)

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 24, 2009, 1:09pm UTC](https://forum.vassalengine.org/t/icons/1469/35 "2009-01-24T13:09:18Z")

</div>

Thus spake “Brent Easton”:

> [@](#):
>
> for icons to be at the same level as images, as we now have in the Vassal sou  
> rce setup.
> 
> B.

No, I mean: Where are you expecting icons/32x32/go-top.png to be, in  
Vengine.jar or somewhere else?

–  
J.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)\
**Post date:** [January 24, 2009, 9:03pm UTC](https://forum.vassalengine.org/t/icons/1469/36 "2009-01-24T21:03:14Z")

</div>

> [@](#):
>
> No, I mean: Where are you expecting icons/32x32/go-top.png to be, in  
> Vengine.jar or somewhere else?

I expect

/icons/32x32/go-top.png

to be in Vengine.jar

I expect

icons/32x32/go-top.png

to be in the module currently being edited/played.

I think I have tracked down the source of the problem - SourceOpBitmapImpl.eval() calls

in = archive.getImageInputStream(name);

to get the archive to return a Stream to the image, DataArchive.getImageInputStream() does this:

if (fileName.startsWith(“/”)) {  
final InputStream in = getClass().getResourceAsStream(fileName);  
if (in != null) return in;  
throw new FileNotFoundException("Resource not found: " + fileName);  
}

try {  
return getInputStream(imageDir + fileName);  
}  
catch (FileNotFoundException e) {  
}

which means that a SourceOp image can be loaded anywhere from within VEngine.jar, but is limited to being below the images directory within a module.

B.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 24, 2009, 9:09pm UTC](https://forum.vassalengine.org/t/icons/1469/37 "2009-01-24T21:09:47Z")

</div>

Thus spake “Brent Easton”:

> [@](#):
>
> > [@](#):
> >
> > No, I mean: Where are you expecting icons/32x32/go-top.png to be, in  
> > Vengine.jar or somewhere else?
> 
> I expect
> 
> /icons/32x32/go-top.png
> 
> to be in Vengine.jar
> 
> I expect
> 
> icons/32x32/go-top.png
> 
> to be in the module currently being edited/played.
> 
> I think I have tracked down the source of the problem - SourceOpBitmapImpl.ev  
> al() calls
> 
> in = archive.getImageInputStream(name);
> 
> to get the archive to return a Stream to the image, DataArchive.getImageInput  
> Stream() does this:
> 
> if (fileName.startsWith(“/”)) {  
> final InputStream in = getClass().getResourceAsStream(fileName);  
> if (in != null) return in;  
> throw new FileNotFoundException("Resource not found: " + fileName);  
> }
> 
> try {  
> return getInputStream(imageDir + fileName);  
> }  
> catch (FileNotFoundException e) {  
> }
> 
> which means that a SourceOp image can be loaded anywhere from within VEngine.  
> jar, but is limited to being below the images directory within a module.
> 
> B.

Yes, I was going to tell you that the problem is with getImageInputStream().  
I think the best solution is to stop using getImageInputStream() and just  
use getInputStream() directly, now that we are pulling images from more  
places than just images/.

–  
J.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)\
**Post date:** [January 24, 2009, 9:18pm UTC](https://forum.vassalengine.org/t/icons/1469/38 "2009-01-24T21:18:38Z")

</div>

> [@](#):
>
> Yes, I was going to tell you that the problem is with  
> getImageInputStream().  
> I think the best solution is to stop using getImageInputStream() and just  
> use getInputStream() directly, now that we are pulling images from more  
> places than just images/.

Hmm, that appears to be a fairly major rewrite of several of the ImageOp implementations, plus whatever calls them to add ‘image/’ to the file name as required.

Plus, as far as I can see, getInputStream() makes no attempt to load a path commencing with “/” from VEngine .jar.

B.

* * *

Brent Easton  
Analyst/Programmer  
University of Western Sydney  
Email: [b.easton@exemail.com.au](mailto:b.easton@exemail.com.au)

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![Brent\_Easton](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/brent_easton/32/10_2.png) [@Brent\_Easton](https://forum.vassalengine.org/u/Brent_Easton)\
**Post date:** [January 24, 2009, 10:14pm UTC](https://forum.vassalengine.org/t/icons/1469/39 "2009-01-24T22:14:16Z")

</div>

Joel,

Another problem is that ArchiveWriter.addImage(path, name) ignores pathnames. It loads all SVG images into /images specifically.

It looks like you did not have pathnames in mind when writing the ImageOp stuff, it only works if everything goes into /images. I am very hesitant to go hacking around in there. Can I leave this with you? I’ll suspend my Icon work until you sort it out.

I don’t believe this is a problem in 3.1, it has only come up because I am trying to stick Icon files where they won’t fit 🙂

I have opened our first 3.2 bug as #2533902.

Thanks,  
B.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

---

<div class="post-metadata">

**Author:** ![uckelman](https://forum.vassalengine.org/user_avatar/forum.vassalengine.org/uckelman/32/10020_2.png) [@uckelman](https://forum.vassalengine.org/u/uckelman)\
**Post date:** [January 25, 2009, 4:04pm UTC](https://forum.vassalengine.org/t/icons/1469/40 "2009-01-25T16:04:55Z")

</div>

Thus spake “Brent Easton”:

> [@](#):
>
> Joel,
> 
> Another problem is that ArchiveWriter.addImage(path, name) ignores pathnames.  
> It loads all SVG images into /images specifically.
> 
> It looks like you did not have pathnames in mind when writing the ImageOp stu  
> ff, it only works if everything goes into /images. I am very hesitant to go h  
> acking around in there. Can I leave this with you? I’ll suspend my Icon work  
> until you sort it out.
> 
> I don’t believe this is a problem in 3.1, it has only come up because I am tr  
> ying to stick Icon files where they won’t fit 🙂
> 
> I have opened our first 3.2 bug as #2533902.

Nope. 2521925 is our first 3.2 bug (which, BTW, I’ve looked at and I don’t  
understand how it could even happen).

> [@](#):
>
> Thanks,  
> B.

I’ll take care of all of this. The root of the problem is that DataArchive  
was built on the assumption that all of the images would be in images/,  
which is no longer the case. Requesting a path rather than just an image  
name would solve this problem.

–  
J.

* * *

Messages mailing list  
[Messages@forums.vassalengine.org](mailto:Messages@forums.vassalengine.org)  
[forums.vassalengine.org/mailman/ … engine.org](http://forums.vassalengine.org/mailman/listinfo/messages_forums.vassalengine.org)

Post generated using Mail2Forum ([mail2forum.com](http://www.mail2forum.com))

[Previous page](https://forum.vassalengine.org/t/icons/1469.md?page=1)
