def glitch &block   # :yield: data
      warn_if_compressed_data_modified

      wrap_with_rewind(@filtered_data) do
        result = yield @filtered_data.read
        @filtered_data.rewind
        @filtered_data << result
        truncate_io @filtered_data
      end
      compress
      self
    end
def glitch &block   # :yield: data
      warn_if_compressed_data_modified

      wrap_with_rewind(@filtered_data) do
        result = yield @filtered_data.read
        @filtered_data.rewind
        @filtered_data << result
        truncate_io @filtered_data
      end
      compress
      self
    end
Manipulates the filtered (decompressed) data as String.

 To set a glitched result, return the modified value in the block.

 Example:

   p = PNGlitch.open 'path/to/your/image.png'
   p.glitch do |data|
     data.gsub /\d/, 'x'
   end
   p.save 'path/to/broken/image.png'
   p.close

 This operation has the potential to damage filter type bytes. The damage will be a cause of
 glitching but some viewer applications might deny to process those results.
 To be polite to the filter types, use +each_scanline+ instead.

 Since this method sets the decompressed data into String, it may use a massive amount of
 memory. To decrease the memory usage, treat the data as IO through +glitch_as_io+ instead.