Reducing size of picture with NO reduction in quality??

  • Thread starter www.SheDumpedMe.net
  • Start date
O

omega

(e-mail address removed):
Chmdump works like a charm. The .exe is 35KB of pure KISS. :)
Again, thank you very much.

I was considering how one might be able to make a batch file for it,
to be used contextually, via sendto or on the explorer context-menu.
Not sure off the top, but makes for an interesting project...

There is a complexity that the parameter of target directory must be
specified. Then furthermore that the target directory cannot already
exist, must be created in the command itself.

chmdump.exe chmfile outdir

So for name of "outdir" that is to be created via the contextual batch
file, it makes sense to give it whatever is the %1 value, the name of
the target chm. How to get there. There were a couple of utilities
provided in solutions for me in ACF not long back, for related needs.
I think I might go over to the drawing board, pull those out, and see
if I can get anywhere on this.

I'm posing the question in advance of my yet taking attempts on my own,
in case someone who is adept with this sort of thing takes interest to
pose a good solution (note - it's for command.com's realm).
 
O

omega

omega said:
(e-mail address removed):

I was considering how one might be able to make a batch file for it,
to be used contextually, via sendto or on the explorer context-menu.

There is a complexity that the parameter of target directory must be
specified. Then furthermore that the target directory cannot already
exist, must be created in the command itself.

chmdump.exe chmfile outdir

So for name of "outdir" that is to be created via the contextual batch
file, it makes sense to give it whatever is the %1 value, the name of
the target chm.

Actually, I wonder if that indeed would be most preferred, to have the
subdir named after the original chm filename. I'm considering now the way
chmdump would most often get used: when the target chm is in individual
directories of various programs. For that kind of case, it might be most
suitable to use instead one preset name, throughout.

Such that the result, for the extraction to web files, they go to a preset
foldername. Something like,

D:\apps\some program\HELPP
D:\apps\other program\HELPP

Whichever for the preset name. I don't like "helpp" either, but was just
trying to consider that a reasonably uncommon foldername would work best.
 
M

me

Actually, I wonder if that indeed would be most preferred,
to have the subdir named after the original chm filename.
I'm considering now the way chmdump would most often get
used: when the target chm is in individual directories of
various programs. For that kind of case, it might be most
suitable to use instead one preset name, throughout.

Such that the result, for the extraction to web files, they
go to a preset foldername. Something like,

D:\apps\some program\HELPP
D:\apps\other program\HELPP

Whichever for the preset name. I don't like "helpp" either,
but was just trying to consider that a reasonably uncommon
foldername would work best.
I thought about that (a batch file) too. It's not critical for
my needs but it would be fun (for me, anyway). I'll mull it
over.

J
 
O

omega

(e-mail address removed):
Chmdump works like a charm. The .exe is 35KB of pure KISS. :)

KISS is excellent.

Might seem ironic, but I'm going to indulge in un-KISSING the matter
of its usage. Justification being that another value is minimizing
overall labor. I like to be able to configure oft-used commandline utils
for single-click execution. So that I do not have to undergo the labor
of typing commands. So I looked into doing that for this one.

The goal is that when you have a chm before you, you can send it to a pif
shortcut in my sendto, or can click an action in your explorer menu, and
that then the extraction will happen automatically.

So we need a batch file for this. The design I chose was to use a preset
folder name. The name I used here was "cmanual." So if you click on a chm
in a program's folder, and have integrated this batch, a subfolder gets
created with that name, which will contain the web files from the extracted
chm.

Btw, I did not specify the location on disk of chmpdump.exe in my batch,
since I'd put that exe in my path (one can drop it in windir etc).

--------------------------chmextr.bat-----------------------------
@echo off
:: note - this is specific to w9x's command.com

:: change to drive and directory of target
%1.\
cd %1\..

:: the command itself
chmdump %1 cmanual\

:: this next part is because I didn't see need for those binary files
cd cmanual
deltree/y $*
deltree/y #*

:: this last part opens up explorer at the new cmanual folder.
:: mostly annoying, on systems where spawsn a new instance of explorer
:: in which case this last line probably best deleted
start .
--------------------------/chmextr.bat-----------------------------

I made a .pif shortcut to the batch. This since the .pif lets me set
properties to not have a lingering console window get left behind after
use ("close on exit"), and also lets me have a custom icon.


1. Put in SendTo

The pif (or the bat) can be put in the sendto folder. Maybe in a subfolder
in sendto, one named eg chm, so not to crowd the root level of sendto. Then
selecting a chm and sending it that shortcut, the extraction gets done.


2a. Registry change: Put in explorer context-menu

For frequent use, this could be promoted to the explorer context menu. By
making a new verb under the chm filetype, and using <path>\chmextr.pif %1
as the command.


2b. Registry change: Create chm filetype keys if system doesn't have it

For the non-msie machine, I would guess that there doesn't exist any chm
filetype defined in the registry. The .reg file below would create the
needed keys.

SHORT VERSION:

----------------------chmfile.reg---------------------------------
REGEDIT4

[HKEY_CLASSES_ROOT\.chm]
@="chmfile"
; set the extension association to our filetype key

[HKEY_CLASSES_ROOT\chmfile\shell]
@="Extract"
; set the default action to the verb Extract

[HKEY_CLASSES_ROOT\chmfile\shell\Extract\command]
@="drive:\\folder\\chmextr.pif %1"
; !! set path to the .pif, and use double slashes
;
----------------------/chmfile.reg---------------------------------


LONG VERSION (includes optional values, more annotations):

----------------------chmfile.reg---------------------------------
REGEDIT4

// Extension key

[HKEY_CLASSES_ROOT\.chm]
@="chmfile"
; set the extension association to our filetype key
; do not do this on a system that already has a filetype key associated with .chm.
; instead you would add an action under the filetype key that's already in place

// Filetype key

[HKEY_CLASSES_ROOT\chmfile]
; @="compiled html file"
; optional, set a long description for display in explorer

[HKEY_CLASSES_ROOT\chmfile\DefaultIcon]
; @="F:\\PIX\\regd\appicon.ico"
; optional, set an icon for explorer view
; change the path to the icon you want to use

[HKEY_CLASSES_ROOT\chmfile\shell]
@="Extract"
; set the default action to the verb Extract (for double-click in explorer, etc)

[HKEY_CLASSES_ROOT\chmfile\shell\Extract]
; @="Extract Contents"
; optional, set a long description of this verb for display in explorer

[HKEY_CLASSES_ROOT\chmfile\shell\Extract\command]
@="D:\\TOOLMAP\\w99\\sendto\\chm\\chmextr.pif %1"
; !! change path
; put the path to your pif here (or your batch itself, if not using a pif)
; make sure to use the double-slashes in the path
;
----------------------/chmfile.reg---------------------------------

Observe that this .reg requires being customized, before ready for use.

First, the paths need to be set. I left in my own paths here, as example
of how looks with the syntax, and also to stand out as something to fix.
The crucial path that needs to be set is the one to the .pif file. (As
well, if wanting a special icon display in explorer, then path there needs
to be set, too.)

Second, I've ;commented out the optional values. So if want to apply one of
those values (as is, or customized), then need to uncomment, and re-merge.
; @="Extract Contents"
@="Extract CHM Contents"

What is handy is to have a text editor associated with .reg (the tiny
Win32pad for example), where you can view or edit what you want in the
file, then click on the execute command from within the editor, to do
a merge.

Important. The .reg is !!NOT for systems already having chm handling.
Merging it there would commit the mean theft-of-associations crime. For
that situation, it'd be best to use a GUI tool. A context-menu editor,
or Windows' own filetypes dialog, or a registry editor. Use one of those
to create a new action under the existing chm filetype, and there, put
in the path to the pif, with the %1.
 
O

omega

(e-mail address removed):
I thought about that (a batch file) too. It's not critical for
my needs but it would be fun (for me, anyway). I'll mull it
over.

You know, another kind of batch file might be of use, one different from
the contextual one. It would be to sweep the entire drive on the non-msie
machine, and do a mass extraction of all found chms.

A couple of months ago, Bjorn S set me up with a utility, and a batch,
for what I wanted, something extremely close in nature to this project.
(I'd wanted to do a mass convert, w calling in a commandline prog, of msft
cabinet exe's into regular cabs.) The utility involved was needed to gather
up commands+filenames for the batch processing. It's named Locate, by
Charles Dye. I'll quote Bjorn's original pointer to it:
Or you could use one of my old time favorite file finders, Locate by
Charles Dye <http://www.highfiber.com/~raster/freeware.htm, with its
macro, batch and Run command features, see
<http://short.stop.home.att.net/freesoft/filefind.htm#locate>

The Locate command could go like this:

locate c:\*.chm /O:"chmdump %1&W cmanual\ " >dochms.bat

Actually, for dealing with the matter of executing the dochms.bat from
a different active drive than the target, I hacked in having each drive
letter entered into the file, in turn:

echo c:>dochms.bat
locate.com c:\*.chm /O:"chmdump %1&W cmanual\ " >>dochms.bat
echo d:>>dochms.bat
locate.com d:\*.chm /O:"chmdump %1&W cmanual\ " >>dochms.bat
:: [etc, for whichever drives or paths to scan]

Here is a sample of my output in dochms.bat:

chmdump "D:\APPS\GRAPHICS\EDITORS\kodakimg\bin\imgtasks.chm" cmanual\
chmdump "D:\APPS\GRAPHICS\EDITORS\mspaint\bin\mspaint.chm" cmanual\
chmdump "D:\APPS\GRAPHICS\VIEWERS\slowview\bin\Help.chm" cmanual\
chmdump "D:\APPS\GRAPHICS\ALBUM\myalb\bin\MyAlbum.chm" cmanual\

I think that Locate.com could be quite similarly used to also make a batch
that will go through the cmanual folders and delete the #* and $* binary
files.

What my whole design ignores is the matter of multiple chms in the same
folder. That's one advantage to redirecting Locate.com to write the batch
file. That you get a list. To then think about what prefer to do on the
chms you read to be sharing the same directory... (And there is no harm
in executing the batch in the meantime, as chmdump merely says, "no I
won't do it because the folder named cmanual already exists here.")
 
M

me

(e-mail address removed):
I thought about that (a batch file) too. It's not critical
for my needs but it would be fun (for me, anyway). I'll
mull it over.

You know, another kind of batch file might be of use, one
different from the contextual one. It would be to sweep the
entire drive on the non-msie machine, and do a mass
extraction of all found chms.

A couple of months ago, Bjorn S set me up with a utility,
and a batch, for what I wanted, something extremely close
in nature to this project. (I'd wanted to do a mass
convert, w calling in a commandline prog, of msft cabinet
exe's into regular cabs.) The utility involved was needed
to gather up commands+filenames for the batch processing.
It's named Locate, by Charles Dye. I'll quote Bjorn's
original pointer to it:
Or you could use one of my old time favorite file
finders, Locate by Charles Dye
<http://www.highfiber.com/~raster/freeware.htm, with its
macro, batch and Run command features, see
<http://short.stop.home.att.net/freesoft/filefind.htm#loc
ate>

The Locate command could go like this:

locate c:\*.chm /O:"chmdump %1&W cmanual\ "
dochms.bat

Actually, for dealing with the matter of executing the
dochms.bat from a different active drive than the target, I
hacked in having each drive letter entered into the file,
in turn:

echo c:>dochms.bat
locate.com c:\*.chm /O:"chmdump %1&W cmanual\ ":: [etc, for whichever drives or paths to scan]

Here is a sample of my output in dochms.bat:

chmdump
"D:\APPS\GRAPHICS\EDITORS\kodakimg\bin\imgtasks.chm"
cmanual\ chmdump
"D:\APPS\GRAPHICS\EDITORS\mspaint\bin\mspaint.chm"
cmanual\ chmdump
"D:\APPS\GRAPHICS\VIEWERS\slowview\bin\Help.chm"
cmanual\ chmdump
"D:\APPS\GRAPHICS\ALBUM\myalb\bin\MyAlbum.chm"
cmanual\

I think that Locate.com could be quite similarly used to
also make a batch that will go through the cmanual folders
and delete the #* and $* binary files.

What my whole design ignores is the matter of multiple chms
in the same folder. That's one advantage to redirecting
Locate.com to write the batch file. That you get a list. To
then think about what prefer to do on the chms you read to
be sharing the same directory... (And there is no harm in
executing the batch in the meantime, as chmdump merely
says, "no I won't do it because the folder named cmanual
already exists here.")

Sweeping the whole drive (or a path) is relatively easy. E.g. I
have a .bat the lists the contents of all .ZIP's is a given
path.

It would help if one could "isolate" file name w/o extension.
For example, given a_drive:a_path\XYZ.CHM, it would be nice to
have "XYZ". By any chance, do you know of a way to do that?

BTW, there are two different work-arounds. Unfortunately, one
depends on a specific version of DOS/windoze and the other
requires running addtional .COM.

J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top