Use iomode => :raw to stop PNG files getting corrupted
Tomas Doran [Mon, 2 Jan 2012 11:34:42 +0000 (11:34 +0000)]
Changes
lib/Catalyst/Helper.pm

diff --git a/Changes b/Changes
index 3a9cb0d..68b2a65 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 This file documents the revision history for Perl extension Catalyst-Devel.
 
+        - Use iomode => ":raw" to stop PNG files getting corrupted
+          when being slurped on windows as noted on the mailing list.
+
 1.36 2011-10-24 17:58:00
         - New apps send an X-Catalyst header by default (this can be
           disabled by changing the config in the generated app)
index 7efa9ba..4d1b861 100644 (file)
@@ -49,7 +49,7 @@ sub get_sharedir_file {
     }
     my $file = file( $dist_dir, @filename);
     Carp::confess("Cannot find $file") unless -r $file;
-    my $contents = $file->slurp;
+    my $contents = $file->slurp(iomode =>  "<:raw");
     return $contents;
 }