Am I putting myself in a world of hurt by compressing all my DSF files?

CypherFOXCypherFOX Posts: 3,401
edited December 1969 in Daz Studio Discussion

Greetings,
I discovered that the majority of DSF files in my content directory are uncompressed, and the ones that are compressed are compressed by the fastest gzip option.

I did a small-scale test, just on data/SWAM.

I compressed the uncompressed DSF files (with gzip -9) and uncompressed and recompressed the files compressed with the 'speed' setting with a better compression level. This resulted in nearly a half gig savings for that tree. It went from 919M to 487M.

My understanding is that DAZ Studio can read compressed files and will decompress them on the fly in order to use them. Given that, what drawbacks am I facing if I run the script I've written on all my .dsf files (98,000 of them!) in my entire 'My Library' tree?

I'm looking at a potential savings of (if the percentages hold up) around 8 gigs, which would be really helpful given March Madness. :)

-- Morgan

Comments

  • Richard HaseltineRichard Haseltine Posts: 102,273
    edited December 1969

    Not really a scripting question, which is the purpose of Developer Discussions, so moved to DAZ Studio Discussions.

    I don't know the answer to the question, sorry.

  • CypherFOXCypherFOX Posts: 3,401
    edited March 2014

    Greetings,
    I understand the moderation choice; in my justification I was scripting (in Ruby) the re/compression script, and the question was mostly about the file formats, which I hoped was close enough to developer discussions.

    So far I haven't had any issues with SWAM's hairs. I'm running the same code on AprilYSH's data directory, and it saved over 600MB. (Went from 905M to 282M!)

    Edit2: I just ran that command and script on my data/Ravenhair directory and it went from 5.1G to 1.3G. Now that's entertainment! :ahhh: :coolgrin:

    -- Morgan

    Edit: Here's the code I'm using...

    find . -iname \*.dsf -exec ~/tweak.rb "{}" \;

    #!/usr/bin/env ruby
    # Passed a file name as a parameter.
    
    require 'fileutils'
    
    mime_type = `file -b --mime-type "#{ARGV[0]}"`.strip
    
    if mime_type == 'text/plain'
      system('gzip', '-9', ARGV[0])
      FileUtils.mv("#{ARGV[0]}.gz", ARGV[0])
    elsif mime_type == 'application/x-gzip'
      FileUtils.mv(ARGV[0], "#{ARGV[0]}.gz")
      system("gunzip", ARGV[0])
      system('gzip', '-9', ARGV[0])
      FileUtils.mv("#{ARGV[0]}.gz", ARGV[0])
    else
      puts "Failed to process: #{ARGV[0]} - Unrecognized format #{mime_type}"
    end
    Post edited by CypherFOX on
  • Thanks for the code (ノ◕ヮ◕)ノ*:・゚✧

Sign In or Register to comment.