Page 1 of 2 12 LastLast
Results 1 to 30 of 60

Thread: Leanify

  1. #1
    Member
    Join Date
    Aug 2014
    Location
    United States
    Posts
    36
    Thanks
    5
    Thanked 23 Times in 10 Posts

    Smile Leanify

    Leanify is a lightweight lossless file minifier/optimizer.
    It support recursive minifying. (e.g. a PNG inside an APK inside a ZIP)
    It supports a wide variety of file formats: zip, xml, png, jpeg, lua, swf, etc. Full list here.
    It's open source on GitHub: https://github.com/JayXon/Leanify
    Download latest release: https://github.com/JayXon/Leanify/releases/

    Please backup your file before using Leanify, just in case of something went wrong, data is priceless.
    Last edited by JayXon; 8th November 2014 at 02:07.

  2. The Following 9 Users Say Thank You to JayXon For This Useful Post:

    Bulat Ziganshin (8th November 2014),Gonzalo (29th August 2014),Jaff (24th November 2014),Matt Mahoney (28th August 2014),m^2 (29th August 2014),samsat1024 (29th August 2014),Sportman (29th August 2014),Stephan Busch (29th August 2014),surfersat (23rd September 2014)

  3. #2
    Member
    Join Date
    Aug 2008
    Location
    Planet Earth
    Posts
    772
    Thanks
    63
    Thanked 270 Times in 190 Posts
    I made very quick the most simple GUI I could made:

    http://www.metacompressor.com/download/leanifygui.zip

    Leanify.exe included, need .NET Framework 3.5

    GUI only support .jpg, original file renamed to .old
    Last edited by Sportman; 29th August 2014 at 21:24.

  4. #3
    Member
    Join Date
    May 2012
    Location
    United States
    Posts
    323
    Thanks
    174
    Thanked 51 Times in 37 Posts
    Great little program!

    Found a bug though: When trying to leanify the "Windows Journal" directory from my Windows 7 computer, it crashes.

    Other than that, great tool.

    *** EDIT *** Never mind...my mistake, I was using the attached test build.
    Last edited by comp1; 30th August 2014 at 09:32.

  5. #4
    Member
    Join Date
    Aug 2014
    Location
    United States
    Posts
    36
    Thanks
    5
    Thanked 23 Times in 10 Posts
    Quote Originally Posted by comp1 View Post
    Great little program!

    Found a bug though: When trying to leanify the "Windows Journal" directory from my Windows 7 computer, it crashes.

    Other than that, great tool.

    *** EDIT *** Never mind...my mistake, I was using the attached test build.
    Hi, could you find out which file caused the crash and upload that file? It'll help me to get rid of the bug.

  6. #5
    Member
    Join Date
    May 2012
    Location
    United States
    Posts
    323
    Thanks
    174
    Thanked 51 Times in 37 Posts
    Quote Originally Posted by JayXon View Post
    Hi, could you find out which file caused the crash and upload that file? It'll help me to get rid of the bug.
    Hi JayXon,

    What happened was I was using the attached file in your original post. That file had the problem. But, then I went to the link you provided and downloaded 0.4.1 and it had no crash on any file.

    It was only the test build that you attached that had a crash. If you want, I can try to find the specific file, but no crashes occur with 0.4.1 from your site.

  7. #6
    Member
    Join Date
    May 2012
    Location
    United States
    Posts
    323
    Thanks
    174
    Thanked 51 Times in 37 Posts
    Possible bug:

    I get an "Open file error! Error code: 5" when trying to use leanify with EXCEL.EXE from Microsoft Office's "Office10" folder.

  8. #7
    Member
    Join Date
    Aug 2014
    Location
    United States
    Posts
    36
    Thanks
    5
    Thanked 23 Times in 10 Posts
    Quote Originally Posted by comp1 View Post
    Hi JayXon,

    What happened was I was using the attached file in your original post. That file had the problem. But, then I went to the link you provided and downloaded 0.4.1 and it had no crash on any file.

    It was only the test build that you attached that had a crash. If you want, I can try to find the specific file, but no crashes occur with 0.4.1 from your site.
    Yes, I know, the test build is like a beta version that I want people to try it out and if bugs are found I can fix it in order to release a stable version in the future. Thanks.

    Quote Originally Posted by comp1 View Post
    Possible bug:

    I get an "Open file error! Error code: 5" when trying to use leanify with EXCEL.EXE from Microsoft Office's "Office10" folder.
    That means you don't have permissions to do that. You can try to run Leanify as a administrator. BTW, if you are using 0.4.1, don't bother exe file, they are only supported in 0.4.2.

  9. #8
    Member
    Join Date
    May 2012
    Location
    United States
    Posts
    323
    Thanks
    174
    Thanked 51 Times in 37 Posts
    Quote Originally Posted by JayXon View Post
    Yes, I know, the test build is like a beta version that I want people to try it out and if bugs are found I can fix it in order to release a stable version in the future. Thanks.



    That means you don't have permissions to do that. You can try to run Leanify as a administrator. BTW, if you are using 0.4.1, don't bother exe file, they are only supported in 0.4.2.
    Ahh ok. I have attached an archive with 2 files that cause a crash.

    EDIT Also crash with MSO97.DLL from MaximumCompression SFC corpus.
    Attached Files Attached Files
    Last edited by comp1; 31st August 2014 at 05:55.

  10. #9
    Member
    Join Date
    Aug 2014
    Location
    United States
    Posts
    36
    Thanks
    5
    Thanked 23 Times in 10 Posts
    Quote Originally Posted by comp1 View Post
    Ahh ok. I have attached an archive with 2 files that cause a crash.

    EDIT Also crash with MSO97.DLL from MaximumCompression SFC corpus.
    I've updated the test build and it should fix the crash.

  11. #10
    Member
    Join Date
    May 2012
    Location
    United States
    Posts
    323
    Thanks
    174
    Thanked 51 Times in 37 Posts
    Fixed...But now crash on another EXE. I have attached it in a 7z archive.
    Attached Files Attached Files

  12. #11
    Member
    Join Date
    Aug 2008
    Location
    Planet Earth
    Posts
    772
    Thanks
    63
    Thanked 270 Times in 190 Posts
    Updated GUI, added all supported file types, made rename to .old optional (default on), added support for fast mode (default off), added option to configure amount of iterations (default 15).

    Download:
    http://www.metacompressor.com/download/leanifygui.zip

  13. #12
    Member
    Join Date
    Aug 2014
    Location
    United States
    Posts
    36
    Thanks
    5
    Thanked 23 Times in 10 Posts
    Quote Originally Posted by comp1 View Post
    Fixed...But now crash on another EXE. I have attached it in a 7z archive.
    This exe seems to be broken, caused by previous test build, sorry about that. I will make it detect and skip any invalid resource address in the next build.
    Could you try if the original exe will make Leanify crash or will be broken by Leanify?

  14. #13
    Member
    Join Date
    May 2012
    Location
    United States
    Posts
    323
    Thanks
    174
    Thanked 51 Times in 37 Posts
    Quote Originally Posted by JayXon View Post
    This exe seems to be broken, caused by previous test build, sorry about that. I will make it detect and skip any invalid resource address in the next build.
    Could you try if the original exe will make Leanify crash or will be broken by Leanify?
    What do you mean? That EXE came from the C:\Program Files\Windows Journal folder. It has not been modified or broken in any way.

    Sorry I do not understand.

  15. #14
    Member
    Join Date
    Aug 2014
    Location
    United States
    Posts
    36
    Thanks
    5
    Thanked 23 Times in 10 Posts
    Quote Originally Posted by comp1 View Post
    What do you mean? That EXE came from the C:\Program Files\Windows Journal folder. It has not been modified or broken in any way.

    Sorry I do not understand.
    The exe you uploaded has been modified by Leanify, it's not the original exe. The original exe should have an icon, but yours doesn't, because the resource section is broken. And it won't run.
    Maybe you uploaded the wrong exe?

  16. #15
    Member
    Join Date
    May 2012
    Location
    United States
    Posts
    323
    Thanks
    174
    Thanked 51 Times in 37 Posts
    Quote Originally Posted by JayXon View Post
    The exe you uploaded has been modified by Leanify, it's not the original exe. The original exe should have an icon, but yours doesn't, because the resource section is broken. And it won't run.
    Maybe you uploaded the wrong exe?
    I did a check and it is the correct, original exe. It is a 64-bit exe and perhaps taht is why you are not seeing an icon. I checked the exe in 3 different places (old installations of Windows 7 I backed up) and the file is exactly the same.

    But, just in case, here it is again from an old Win7 backup I had.
    Attached Files Attached Files

  17. #16
    Member
    Join Date
    Aug 2014
    Location
    United States
    Posts
    36
    Thanks
    5
    Thanked 23 Times in 10 Posts
    Quote Originally Posted by comp1 View Post
    I did a check and it is the correct, original exe. It is a 64-bit exe and perhaps taht is why you are not seeing an icon. I checked the exe in 3 different places (old installations of Windows 7 I backed up) and the file is exactly the same.

    But, just in case, here it is again from an old Win7 backup I had.
    This time the exe is correct, thank you, I'll investigate the crash.

  18. #17
    Member
    Join Date
    Aug 2014
    Location
    United States
    Posts
    36
    Thanks
    5
    Thanked 23 Times in 10 Posts
    I have updated the test build with some bug fixes and fb2 format support.

  19. #18
    Member
    Join Date
    Aug 2014
    Location
    United States
    Posts
    36
    Thanks
    5
    Thanked 23 Times in 10 Posts
    I have released Leanify 0.4.2
    • Added support for PE.
    • Added support for tar.
    • Added support for fb2.
    • Added support for removing SVG metadata.
    • New -d option to specify maximum recursive depth.
    • Updated TinyXML2 to 2.2.0
    • Enable SSE2 and Link Time Optimization.
    • Win: Added 64-bit build.
    • Win: More meaningful error message.
    • Linux, Mac: Fixed printing UTF16 string.
    • Other optimizations and bug fixes.
    https://github.com/JayXon/Leanify/releases

  20. The Following User Says Thank You to JayXon For This Useful Post:

    surfersat (8th November 2014)

  21. #19
    Member just a worm's Avatar
    Join Date
    Aug 2013
    Location
    planet "earth"
    Posts
    96
    Thanks
    29
    Thanked 6 Times in 5 Posts
    Your compiled version for Windows 32 Bit does not work in Windows XP. The loader doesn't let it through because a value of the PE file format says that the required subsystem version is 6.0. It probably doesn't work on Windows 2000 either. I tried to lower the value and it works in Windows XP.

    A good value for this field is "4.0". Windows XP accepts up to 5.x I think.

    I tried your programm on an executable of mine. The executable is not compressed in any way. But still your programm couldn't get a byte out. Anyway it still threw the beginning of the PE headers in the DOS area by overlapping/collapsing the areas. Are you aware, that the programm might expect that in run time thouse bytes from the DOS area are set to the original values because the programm uses the space for something?

    Afterwards I tried your programm on a system driver. It made some changes and decrease the file size but kept the checksum intact. Thereby the driver is not working anymore.

    Is it possible to "deleanify" a file to it's original state to prove that it's lossless?

  22. The Following 2 Users Say Thank You to just a worm For This Useful Post:

    Jaff (24th November 2014),surfersat (19th November 2014)

  23. #20
    Member
    Join Date
    Aug 2014
    Location
    United States
    Posts
    36
    Thanks
    5
    Thanked 23 Times in 10 Posts
    Quote Originally Posted by just a worm View Post
    Your compiled version for Windows 32 Bit does not work in Windows XP. The loader doesn't let it through because a value of the PE file format says that the required subsystem version is 6.0. It probably doesn't work on Windows 2000 either. I tried to lower the value and it works in Windows XP.

    A good value for this field is "4.0". Windows XP accepts up to 5.x I think.

    I tried your programm on an executable of mine. The executable is not compressed in any way. But still your programm couldn't get a byte out. Anyway it still threw the beginning of the PE headers in the DOS area by overlapping/collapsing the areas. Are you aware, that the programm might expect that in run time thouse bytes from the DOS area are set to the original values because the programm uses the space for something?

    Afterwards I tried your programm on a system driver. It made some changes and decrease the file size but kept the checksum intact. Thereby the driver is not working anymore.

    Is it possible to "deleanify" a file to it's original state to prove that it's lossless?
    Thanks for the feedback.

    I didn't set the subsystem version to 6.0 on purpose, but that's the default value, I'll see if I can change that. BTW you really shouldn't be using XP now, since the support has ended.

    Leanify is not a packer on exe file, the only thing it does is strip some unnecessary information and perform optimization on embedded resources.

    I know it is possible to use those bytes in runtime, but I think most of the exe won't do that. And there's no way to detect it.

    I can't test any driver files, I'm running Win8.1 x64, drivers in 64 bit won't load if digital signature doesn't match, so there's no point to modify any driver. I think I should let Leanify to skip all drivers.

    No, Leanify is not a compressor, lossless here means the file after leanify will perform the same way as it before.

  24. #21
    Member nikkho's Avatar
    Join Date
    Jul 2011
    Location
    Spain
    Posts
    542
    Thanks
    214
    Thanked 163 Times in 104 Posts
    If anyone is interested, daily builds can be downloaded from AppVeyor:
    https://ci.appveyor.com/project/JayXon/leanify

  25. The Following User Says Thank You to nikkho For This Useful Post:

    Jaff (23rd January 2015)

  26. #22
    Member Jaff's Avatar
    Join Date
    Oct 2012
    Location
    Dracula's country
    Posts
    100
    Thanks
    112
    Thanked 20 Times in 16 Posts
    Would you like to add a small hack to optimise htm/html/css etc web based files wich contains base64 encoded images?
    Detect base64 image, convert to binary file, optimise it, encode it back to base64 and replace original image in document.
    It work with .png, .gif, .jpeg images. Thank you in advance!

    some usefull info: http://en.wikipedia.org/wiki/Data_URI_scheme

  27. #23
    Member nikkho's Avatar
    Join Date
    Jul 2011
    Location
    Spain
    Posts
    542
    Thanks
    214
    Thanked 163 Times in 104 Posts
    I already recorded it on Leanify's issue tracker https://github.com/JayXon/Leanify/issues/14

  28. The Following 3 Users Say Thank You to nikkho For This Useful Post:

    Jaff (24th April 2015),JayXon (24th April 2015),lorents17 (2nd May 2015)

  29. #24
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts
    a quick suggestion that UPX and Mpress seems to forget.
    Icon's since vista can be compressed like png. My icon file for Project Mercury was 361kb having 16x16 to 256x256 32bit icons. after compression the 128x128 and 256x256 icons its was down to 60kb
    My other icons with the same szies of icons got fomr 361kb down to 73kb. resultsing in the .exe file with the imported icons was smaller.

    soo that would be a nice feature for an .exe optimizer to compress 128x128 icons and higher in default mode ( leaving smaller ones for XP and 2k usage)
    Last edited by SvenBent; 24th April 2015 at 22:57.

  30. #25
    Member
    Join Date
    Aug 2014
    Location
    United States
    Posts
    36
    Thanks
    5
    Thanked 23 Times in 10 Posts
    Quote Originally Posted by SvenBent View Post
    a quick suggestion that UPX and Mpress seems to forget.
    Icon's since vista can be compressed like png. My icon file for Project Mercury was 361kb having 16x16 to 256x256 32bit icons. after compression the 128x128 and 256x256 icons its was down to 60kb
    My other icons with the same szies of icons got fomr 361kb down to 73kb. resultsing in the .exe file with the imported icons was smaller.

    soo that would be a nice feature for an .exe optimizer to compress 128x128 icons and higher in default mode ( leaving smaller ones for XP and 2k usage)
    Leanify is already optimizing png inside ico and ico inside exe.

    If it's not working for you, please provide the file that can reproduce the problem.

  31. #26
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts
    Quote Originally Posted by JayXon View Post
    Leanify is already optimizing png inside ico and ico inside exe.

    If it's not working for you, please provide the file that can reproduce the problem.
    In fileoptimizer leanify crashes
    I just downloaded latest win64 from your site and its crashes as well on both my.ico files
    Attached Files Attached Files

  32. The Following User Says Thank You to SvenBent For This Useful Post:

    JayXon (26th April 2015)

  33. #27
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts
    Double Post - Please Delete me

  34. #28
    Member
    Join Date
    Aug 2014
    Location
    United States
    Posts
    36
    Thanks
    5
    Thanked 23 Times in 10 Posts
    Quote Originally Posted by SvenBent View Post
    In fileoptimizer leanify crashes
    I just downloaded latest win64 from your site and its crashes as well on both my.ico files
    Thanks for those files. I've fixed the problem in the latest commit. You can try the x64 build here

  35. The Following User Says Thank You to JayXon For This Useful Post:

    SvenBent (26th April 2015)

  36. #29
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts
    THank you it seems to be working fine. got my icon file from 60 to 54. are you considierng addign a switch to make leanify change 256x256 non compesses icon into compress icons ? since 256x256 is only supported by windows that support compressed icons anyway ther should not be any compatibility to worry about

  37. #30
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    856
    Thanks
    45
    Thanked 104 Times in 82 Posts
    Quick curios question. what kinds of tricks do leanify do on the PNG images in an .ICO file ?

Page 1 of 2 12 LastLast

Posting Permissions

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