Modify

Ticket #120 (closed defect: invalid)

Opened 5 years ago

Last modified 5 years ago

stripphpcomments currupts some .png files while using copy?

Reported by: bonebreaker@… Owned by: hans
Priority: major Milestone:
Component: phing-core Version: 2.2.0
Keywords: stripphpcomments Cc:

Description

I had a copy task working on a fileset with stripphpcomments in the filterchain.

Some .png files were corrupted in the process, I removed the filterchain from the copy task and now it all works fine. Only some .png files were corrupted (< 10%) I attached one of the .png that got corrupted by Phing so that you can try to reproduce.

Attachments

a_tl.png Download (3.7 KB) - added by bonebreaker@… 5 years ago.
.png file corrupted by stripphpcomments

Change History

Changed 5 years ago by bonebreaker@…

.png file corrupted by stripphpcomments

comment:1 Changed 5 years ago by hans

  • Status changed from new to closed
  • Resolution set to invalid

The correct way to deal with this is to make sure that *.png files are not included in the copy.

For example:

<!-- first copy everything except PHP files -->
<copy todir="${destdir}">
   <fileset dir="${srcdir}">
     <include name="**"/>
     <exclude name="**/*.php"/>
   </fileset>
</copy>

<!-- now copy only the PHP files and use a filterchain -->
<copy todir="${destdir}">
   <fileset dir="${srcdir}">
     <include name="**/*.php"/>
   </fileset>
   <filterchain>
     <stripphpcomments/>
   </filterchain>
</copy>
View

Add a comment

Modify Ticket

Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.