Results 1 to 10 of 10

Thread: strange behavior with precomp and full path name

  1. #1
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    873
    Thanks
    49
    Thanked 106 Times in 84 Posts

    strange behavior with precomp and full path name

    if i use precomp -r with a full path name. The output file is writing in my current directory and not in the directory of the input files.

    if i use packjpg. the outputs files are in the same directory is the input
    e.g

    i'm "standing" in e:\test\

    Precomp -r E:\test\subfolder\file.pcf
    Gives me file.jpg in E:\test\

    Packjpg e:\test\subfolder\file.jpg
    Fives me file.jpeg in e:\test\subfolder\


    Please "fix" precomp to output file same places as input file

    also "delete af decompression" arguments would be nice for automatically clean-up after doing multithreaded batch to decompress pcf back to jpg/pdf.
    Last edited by SvenBent; 19th August 2009 at 23:51.

  2. #2
    Programmer schnaader's Avatar
    Join Date
    May 2008
    Location
    Hessen, Germany
    Posts
    566
    Thanks
    217
    Thanked 200 Times in 93 Posts
    Thanks for reporting this, this is strange especially when using Precomp Comfort. I'll try to fix this in the next version (although I don't know if I will perhaps keep an optional switch to keep the old behaviour). Same for adding a "delete after decompression" switch.
    Last edited by schnaader; 20th August 2009 at 02:39.
    http://schnaader.info
    Damn kids. They're all alike.

  3. #3
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    873
    Thanks
    49
    Thanked 106 Times in 84 Posts
    I'm not using precomp comfort. just the normal command line version.

    i discoverede it because i used the following command to "decompress" from all sub folders

    for /r %f in (*.pcf) do precomp -r "%f"

  4. #4
    Programmer schnaader's Avatar
    Join Date
    May 2008
    Location
    Hessen, Germany
    Posts
    566
    Thanks
    217
    Thanked 200 Times in 93 Posts
    By the way, a possible solution for doing this using the actual version would be to use 2 batch files:

    Code:
    REM batch1.bat
    for /r %%f in (*.pcf) do call batch2 %%~dpf %%~nxf
    Code:
    REM batch2.bat
    pushd %1
    precomp -r %2
    popd
    Last edited by schnaader; 4th September 2009 at 12:17.
    http://schnaader.info
    Damn kids. They're all alike.

  5. #5
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    873
    Thanks
    49
    Thanked 106 Times in 84 Posts
    thanx for the batch script.

    i will try ti implant into my bath file

  6. #6
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    873
    Thanks
    49
    Thanked 106 Times in 84 Posts
    just need to understand the method because if it does what i think it does you just helped me with alot of other batch scripts


    the for line call batch2 with
    %1= being path with no file name
    %2 = File name

    right ?

    Pushd %1 = go to the path %1 but remember current path
    precomp -r %2 = run precomp /r in file
    Popd = go back the "current dir" before Pushd jumped away


    my other batches i needed to save %cd% into a variable and later do "CD %variable%"
    this is just so much easier
    Last edited by SvenBent; 5th September 2009 at 09:28.

  7. #7
    Programmer schnaader's Avatar
    Join Date
    May 2008
    Location
    Hessen, Germany
    Posts
    566
    Thanks
    217
    Thanked 200 Times in 93 Posts
    Quote Originally Posted by SvenBent View Post
    just need to understand the method because if it does what i think it does you just helped me with alot of other batch scripts


    the for line call batch2 with
    %1= being path with no file name
    %2 = File name

    right ?

    Pushd %1 = go to the path %1 but remember current path
    precomp -r %2 = run precomp /r in file
    Popd = go back the "current dir" before Pushd jumped away


    my other batches i needed to save %cd% into a variable and later do "CD %variable%"
    this is just so much easier
    I'm glad I could help you Yes, that's exactly how it works. PUSHD, POPD and the enhanced FOR syntax (%%~dpf %%~nxf) are features that are available for Windows 2000 and above. You can call the help for FOR using "for /?", there is much text, but this is the most interesting part of it for this script:

    Code:
    In addition, substitution of FOR variable references has been enhanced.
    You can now use the following optional syntax:
     [...]
        %~dI        - expands %I to a drive letter only
        %~pI        - expands %I to a path only
        %~nI        - expands %I to a file name only
        %~xI        - expands %I to a file extension only
     [...]
    The modifiers can be combined to get compound results:
    
        %~dpI       - expands %I to a drive letter and path only
        %~nxI       - expands %I to a file name and extension only
    http://schnaader.info
    Damn kids. They're all alike.

  8. #8
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    873
    Thanks
    49
    Thanked 106 Times in 84 Posts
    fails with folders with spaces

    trying to make "%1" in batch2 but seems it still fails as the path is delivered to batch with space end there for only first part of the parts is %1 inside batch 2

    -- edit --
    got it to work by doing the "" in batch 1
    however i found another weirdness of precomp.
    it doesn't handle file with space pretty well.

    doing
    precomp -r "000 167.pcf"

    turns my 000 167.pcf file into 167.jpg
    so it truncates the first part of the name
    Last edited by SvenBent; 6th September 2009 at 14:31.

  9. #9
    Programmer schnaader's Avatar
    Join Date
    May 2008
    Location
    Hessen, Germany
    Posts
    566
    Thanks
    217
    Thanked 200 Times in 93 Posts
    Quote Originally Posted by SvenBent View Post
    doing
    precomp -r "000 167.pcf"

    turns my 000 167.pcf file into 167.jpg
    so it truncates the first part of the name
    Strange - works for me, perhaps there are other things involved in this. Could you give more details? The filename is stored inside the PCF, so it seems the first (precompression) step went wrong.
    http://schnaader.info
    Damn kids. They're all alike.

  10. #10
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    873
    Thanks
    49
    Thanked 106 Times in 84 Posts
    Quote Originally Posted by schnaader View Post
    The filename is stored inside the PCF...
    Ups my bad. i didnt know pcf keep the original filename.

    I had just renamed a pcf. file to have a space. and tested it. it never occurede to me that precomp contained info about the original name. maybe because it only works one file a time.

Similar Threads

  1. Precomp (and Precomp Comfort) in 315 kb
    By Yuri Grille. in forum Data Compression
    Replies: 2
    Last Post: 1st April 2009, 20:40
  2. NEW FULL BWTS COMPRESSOR
    By biject.bwts in forum Data Compression
    Replies: 2
    Last Post: 20th January 2009, 21:10
  3. Replies: 3
    Last Post: 8th July 2008, 16:55
  4. Strange gcc4.3 results with paq8o8
    By Hahobas in forum Forum Archive
    Replies: 8
    Last Post: 22nd March 2008, 20:44
  5. Precomp 0.3.5 is out!
    By squxe in forum Forum Archive
    Replies: 1
    Last Post: 20th August 2007, 15:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •