1. Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

TPU.org specific size limitation

Discussion in 'Comments & Feedback' started by FordGT90Concept, Apr 1, 2011.

  1. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,596 (6.24/day)
    Thanks Received:
    3,519
    Location:
    IA, USA
    It says 2 MB but does that mean:
    2 MB = 2,000,000 bytes
    or
    2 MiB = 2,097,152 bytes
     
    Crunching for Team TPU
  2. n-ster

    Joined:
    Jan 11, 2009
    Messages:
    8,859 (4.24/day)
    Thanks Received:
    1,405
    test it yourself? it cant be that hard

    (not trying to be mean, sry if it came out that way)
     
    FordGT90Concept says thanks.
  3. n-ster

    Joined:
    Jan 11, 2009
    Messages:
    8,859 (4.24/day)
    Thanks Received:
    1,405
    Last edited: Apr 1, 2011
    FordGT90Concept says thanks.
  4. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,596 (6.24/day)
    Thanks Received:
    3,519
    Location:
    IA, USA
    Crunching for Team TPU
  5. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,596 (6.24/day)
    Thanks Received:
    3,519
    Location:
    IA, USA
    Here's the result of why I asked (attached). It's a commandline, .NET 4.0 application (Client Profile will NOT work):

    Code:
    tpuresize "in" [-out "out"] [-x pixels] [-y pixels] [-size mebibytes] [-fill colorname] [-transparency colorname] [-notransparency]
    in = Path to the input file. For example: "C:\mypic.png"

    -out = Optional. Where to save. The extension of the file determines its "save as" type. Currently, only JPG, GIF, and PNG are supported. If not one of those three, it will try to save as the same type of file that was input. For example: -out "C:\folder\pic.gif"

    -x = Optional. Limit the width of output image in pixels. For example: -x 1920

    -y = Optional. Limit the height of the output image in pixels. For example: -y 1200

    -size = Optional. Limit the size of the output image in mebibytes (2^20). For example: -size 10

    -fill = Optional. Fills the entire picture with a single color before pasting the image on. This color will show through transparent areas of the image. For example: -fill white

    -transparency OR -transparent = Optional. Color to make transparent when saving as a PNG. Here's the color names it will accept. For example: -transparency white

    -notransparency OR -notransparent = Optional. Removes all transparency effects during the conversion.


    You can drag and drop an image on it and it will default to the following (what is required by techpowerup.org):
    Code:
    tpuresize "%" -out "%_resized.jpg" -size 2
    A random example using all parameters:
    Code:
    tpuresize "C:\mypic.png" "C:\folder\pic.gif" -x 1920 -y 1200 -size 10 -transparency white
    The order they appear in does not matter as long as a command (starts with -) is followed by a value.

    Code:
    tpuresizebatch "file0" "file1" "file2" "..."
    When it is first ran (must have a file in the commandline), it will create a tpuresizebatch.ini which has mostly the same settings as TpuResize. The one exception is "AppendFileName" which behaves similar to -out. This is the most important parameter because it determines the output file type. JPEG, JPG, GIF, and PNG are supported. Default is "_resized.jpg" (same as TpuResize).

    Recommended to extract before running either application.
     

    Attached Files:

    Last edited: Jul 22, 2014
    theJesus, Bundy and jmcslob say thanks.
    Crunching for Team TPU
  6. jmcslob

    Joined:
    Mar 14, 2009
    Messages:
    2,929 (1.44/day)
    Thanks Received:
    474
    Location:
    Internet Heaven
    Wow I just came across the need for this the other night on GN....what a coincidence :rolleyes:

    Thanks Ford
     
  7. W1zzard

    W1zzard Administrator Staff Member

    Joined:
    May 14, 2004
    Messages:
    14,909 (3.93/day)
    Thanks Received:
    11,668
    or you could use imagemagick for win32
     
  8. entropy13

    entropy13

    Joined:
    Mar 2, 2009
    Messages:
    4,936 (2.42/day)
    Thanks Received:
    1,211
    Not all of use can use spells...
     
  9. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,596 (6.24/day)
    Thanks Received:
    3,519
    Location:
    IA, USA
    Imagemagick does not do what this app does (make an image fit within x, y, and/or file size constraints) as far as I can tell.
     
    Last edited: Apr 2, 2011
    Crunching for Team TPU
  10. W1zzard

    W1zzard Administrator Staff Member

    Joined:
    May 14, 2004
    Messages:
    14,909 (3.93/day)
    Thanks Received:
    11,668
    there are lots of options for scaling but nothing to target a specific file size
     
  11. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,596 (6.24/day)
    Thanks Received:
    3,519
    Location:
    IA, USA
    Exactly. This app is also tuned specifically to TPU.org so it will make almost any image acceptable to upload by simply dragging and dropping the image on the executable. ;)
     
    jmcslob says thanks.
    Crunching for Team TPU
  12. Jizzler

    Jizzler

    Joined:
    Aug 10, 2007
    Messages:
    3,420 (1.31/day)
    Thanks Received:
    639
    Location:
    Geneva, FL, USA
    -define jpeg:extent=2MB

    (though I'm not on my box with IM setup to test if it takes in MB, MiB, or Mb as expected).

    Probably good in conjunction with -type optimize.
     
  13. newtekie1

    newtekie1 Semi-Retired Folder

    Joined:
    Nov 22, 2005
    Messages:
    19,966 (6.17/day)
    Thanks Received:
    6,047
    Is it possible to change the output image type from the input?
     
    Crunching for Team TPU More than 25k PPD
  14. Easy Rhino

    Easy Rhino Linux Advocate

    Joined:
    Nov 13, 2006
    Messages:
    13,434 (4.67/day)
    Thanks Received:
    3,243
    with imagemagick yes, i dont know about tpu.org though.
     
  15. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,596 (6.24/day)
    Thanks Received:
    3,519
    Location:
    IA, USA
    Yes, just use -out and give it a different extension (like .jpg). It will only convert when the out extension is JPG, PNG, or GIF (the types TPU.org will accept). If out is not one of those three, it will attempt to preserve the same format as input.


    It's supposed to be -transparent instead of -transparency but, I added both so either will work in 1.0.1 (uploading shortly).


    Edit: Uploaded.
     
    Last edited: Apr 4, 2011
    Crunching for Team TPU
  16. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,596 (6.24/day)
    Thanks Received:
    3,519
    Location:
    IA, USA
    Uploaded 1.0.2 which has -notransparent and -notransparency flags.


    Uploaded 1.0.3 which has the -fill flag.
     
    Last edited: Apr 4, 2011
    Crunching for Team TPU
  17. jmcslob

    Joined:
    Mar 14, 2009
    Messages:
    2,929 (1.44/day)
    Thanks Received:
    474
    Location:
    Internet Heaven
    Ford this app rocks....drag drop no thinking required.....perfect
     
  18. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,596 (6.24/day)
    Thanks Received:
    3,519
    Location:
    IA, USA
    Heh, yeah. I use it on virtually every image I upload to TPU.org--if only to convert the image to JPG from PNG. So much faster than doing it in MS Paint. ;)
     
    Crunching for Team TPU
  19. theJesus

    theJesus

    Joined:
    Jul 20, 2008
    Messages:
    3,968 (1.75/day)
    Thanks Received:
    860
    Location:
    Ohio
    Will this do batch operations?
     
  20. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,596 (6.24/day)
    Thanks Received:
    3,519
    Location:
    IA, USA
    Nope because of all the options although a batch could be written to call it over and over again.


    I could make a separate executable that is intended for batch operations using the default settings and the settings can be modified via INI or XML file. The "-out" flag would obviously be omitted though.

    Edit: Programming note: Program.MakeItFit (what does all the work) is publically accessible so any .NET program could call the function within the executable.
     
    Crunching for Team TPU
  21. theJesus

    theJesus

    Joined:
    Jul 20, 2008
    Messages:
    3,968 (1.75/day)
    Thanks Received:
    860
    Location:
    Ohio
    Do that and have it automatically upload the images and I'll love you lol
     
  22. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,596 (6.24/day)
    Thanks Received:
    3,519
    Location:
    IA, USA
    W1zzard would have to approve the automatic uploading and probably have to make some changes to facilitate it. That would also require making a Windows application to show individual upload progress.

    I can make a batch-friendly version though (drag and drop many files) relatively quick though...
     
    Last edited: May 28, 2011
    theJesus says thanks.
    Crunching for Team TPU
  23. theJesus

    theJesus

    Joined:
    Jul 20, 2008
    Messages:
    3,968 (1.75/day)
    Thanks Received:
    860
    Location:
    Ohio
    I'm sure the batch-friendly version would be useful for many members.

    In regards to automatic uploading, yes W1z would have to approve it, but I don't think changes would need to be made. TPUCapture already has automatic uploading.
     
    FordGT90Concept says thanks.
  24. FordGT90Concept

    FordGT90Concept "I go fast!1!11!1!"

    Joined:
    Oct 13, 2008
    Messages:
    13,596 (6.24/day)
    Thanks Received:
    3,519
    Location:
    IA, USA
    Have a preference for INI or XML? I prefer INI but I can do either. INI would only have one file and XML would have two (XML and DTD).

    I am going to make it create the config file if it is not found so the config file is easy to reset/access.
     
    Crunching for Team TPU
  25. theJesus

    theJesus

    Joined:
    Jul 20, 2008
    Messages:
    3,968 (1.75/day)
    Thanks Received:
    860
    Location:
    Ohio
    I prefer INI as well.
     
    FordGT90Concept says thanks.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page