Reduce storage size of 'thumbs' folder (MovPic + TVSeries) (1 Viewer)

Jeditrav

Portal Pro
May 17, 2007
319
20
New Zealand New Zealand
Thanks. I tried all of that, still doesn't work - get exactly the same error message and log. Having the "C:\DOCUME~1\Zalman\LOCALS~1\Temp\" folder open while running the cmd I see that a 'MovPic.png' file is created, and each time I click on that file the preview image is different, so it seems that it is creating/duplicating a 'MovPic.png' for each image but not correctly processing/copying them back to replace the original oversized images??? I don't know! Any other ideas?
 

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,338
    1,824
    Country flag
    • Thread starter
    • Moderator
    • #52
    Thanks. I tried all of that, still doesn't work - get exactly the same error message and log. Having the "C:\DOCUME~1\Zalman\LOCALS~1\Temp\" folder open while running the cmd I see that a 'MovPic.png' file is created, and each time I click on that file the preview image is different, so it seems that it is creating/duplicating a 'MovPic.png' for each image but not correctly processing/copying them back to replace the original oversized images??? I don't know! Any other ideas?
    Ok, that means the problem occurs on the image reduction or on the copying back part.

    It's a pretty dumb script, it transgresses into your thumbs folder, copies the pictures it finds to the temp folder as MovPic.png, then it tries to convert them into MovPic.jpg via the nconvert.exe, if successful it verifies if the filesize is below the threshold and if not, tries to nconvert.exe with strong compression settings, etc.

    Add a "pause" line before and after the following line:

    copy "%TMP%\MovPic.jpg" "%%i" > nul​

    Because that is the line that takes the final version of the reduced result to copy it back to the original filename. Then you can monitor the %TMP% folder, which is "C:\DOCUME~1\Zalman\LOCALS~1\Temp\" in your case to see if that file got created. If it did not get created, the problem lies in the nconvert.exe process. If it does and it does not get copied over to were it is supposed to go, then you most likely have to fix write permissions issues on that import path (maybe read only ACL?)
     

    Jeditrav

    Portal Pro
    May 17, 2007
    319
    20
    New Zealand New Zealand
    Write permissions etc are all good, I dunno what's wrong, doesn't want to work for me. I've since processed all the images through an IrfanView batch conversion, all done now.
    Thanks for your help.
     

    Terra

    Portal Pro
    August 25, 2009
    230
    56
    Austria Austria
    Country flag
    I have the same problem "Error: Can't create file" I tried to change the TMP directory in the script and I also called the exe manually with the same command the script would use, no luck.

    The "MovPic" file was created successfully all the time, it seems that nconvert.exe can't see/find it and throws an error?!

    I also tried to launch the script in compatibilty mode and used the new nconvert 5.60, no luck :(

    I use Win7
     

    elliottmc

    Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    United Kingdom United Kingdom
    Country flag
    Hi,

    If you install MediaPortal 1.1.0RC1, then you do not need to do this. That is, MediaPortal will not try to cache .png thumb files (which is what has given the crashes on startup) from moving pictures or mytvseries. This was fixed on the MediaPortal side of things. (I know that the current build - not sure if this is public yet - of moving pictures has a fix for this problem as well)

    Mark
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,338
    1,824
    Country flag
    • Thread starter
    • Moderator
    • #56
    I also tried to launch the script in compatibilty mode and used the new nconvert 5.60, no luck :(
    Maybe that's the problem, I wrote this batch script with NConvert v5.54, possibly they changed syntax, so I'll download v5.60 myself and verify.

    If you install MediaPortal 1.1.0RC1, then you do not need to do this.
    Yes, the PNG problem is no longer the main reason for this script if you have updated things. But total storage can still be a problem. Even with MovingPictures v1.0.3+ having build in support to reduce images, you might be stuck with large filesized images with a resolution below the thresholds.

    There are plenty of 1MB+ covers and backdrops as such on themoviedb website. Since this script works on filesize and not resolution, it can help avoid running into storage problems. Especially for users on a small OS partition, or small SSD, this can become an issue.
     

    Terra

    Portal Pro
    August 25, 2009
    230
    56
    Austria Austria
    Country flag
    Maybe that's the problem, I wrote this batch script with NConvert v5.54, possibly they changed syntax, so I'll download v5.60 myself and verify.
    First I used the exe that was linked in the first post, after that I tried to use the new 5.60 version. I don't think its the syntax...

    My main motivation in using this script is not saving disc space, I have enough. I want more performance in Moving Pictures.

    Terra
     

    trythisone

    Portal Member
    April 13, 2008
    16
    2
    I'm having the same can't create file error. But I can get around it by specifying a different output file (ie. -o "%TMP%\MovPic1.png" ).

    Update: By adding
    -o "%TMP%\MovPic1.png
    to every nconvert call and then putting

    Move "%TMP%\MovPic1.png" "%TMP%\MovPic.png"

    on the next line I was ablr to get the script to work
    (It's a bit of a hack, but less likely to break the script)
     

    heaso1

    Portal Member
    July 9, 2008
    6
    2
    Newcastle
    Australia Australia
    After a lot of swearing I finally got the batch file to run.

    I'm running XP pro and had the "Can't create file" error.

    I followed Trythisone's advice and amended the nconvert calls from:

    nconvert.exe -quiet -out jpeg -ratio -resize 0 1080 -q 85 -rmeta -rflag decr -opthuff "%TMP%\MovPic.png" > nul

    to

    nconvert.exe -quiet -out jpeg -ratio -resize 0 1080 -q 85 -rmeta -rflag decr -opthuff -o "%TMP%\MovPic1.png" "%TMP%\MovPic.png" > nul
    Move /y "%TMP%\MovPic1.png" "%TMP%\MovPic.png"

    Notice I had to add a /y to the Move command.

    Also, where the copy command is used to copy the newly shrunken file back to it's original directory, I had to alter the extension from:

    copy "%TMP%\MovPic.jpg" "%%i" > nul

    to

    copy "%TMP%\MovPic.png" "%%i" > nul

    Here's the finished product in case anyone wants to try it. After download, just rename the .txt to .cmd (and obviously put it in the same directory as the previously downloaded nconvert.exe file).

    Big thanks to Rochess for doing the hard work. I couldn't write a batch file to save my life! :)

    View attachment !MediaPortal Fix Thumbs heaso1 style.txt
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    Top Bottom