You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Chris Funk (JIRA)" <ji...@codehaus.org> on 2006/03/08 18:15:23 UTC

[jira] Commented: (ARCHETYPE-25) images gif/jpgs etc seem to get corrupted when copied by archetype

    [ http://jira.codehaus.org/browse/ARCHETYPE-25?page=comments#action_60487 ] 

Chris Funk commented on ARCHETYPE-25:
-------------------------------------

I think it is a bit more complicated than that.

I did the following primitive hack to the process template method and still have the same issue, it seems there might be something about copying images out of a jar resource.  Don't know didn't spend too much time on it:

if (template.endsWith(".jpg") || template.endsWith(".gif")) {
            try {
                template = ARCHETYPE_RESOURCES + "/" + template;
                InputStream is = getStream(template, Thread.currentThread()
                        .getContextClassLoader());
                OutputStream os = new FileOutputStream(f);
                int ch; // the buffer
                while ((ch = is.read()) != -1) {
                    os.write(ch);
                }
                is.close();
                os.close();

            } catch (Exception e) {
                getLogger().error("Could not copy image " + e.getMessage());
            }
            return;
        }

this had the exact same result


> images gif/jpgs etc seem to get corrupted when copied by archetype
> ------------------------------------------------------------------
>
>          Key: ARCHETYPE-25
>          URL: http://jira.codehaus.org/browse/ARCHETYPE-25
>      Project: Maven Archetype
>         Type: Bug

>   Components: maven-archetype-plugin
>  Environment: windows XP
>     Reporter: Chris Funk
>     Assignee: Jason van Zyl
>     Priority: Minor

>
>
> I created a web archetype to include images in the src/main/webapp directory.
> They seem to copy over correctly and there size is reatined, but oddly the images view as blank when displayed in browser or image viewer.
> I double checked to make sure the images I was using were ok and manually copied them over and everything worked fine.  I have the images in the resources section in archetype.xml.  Could be an encoding issue?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira