Folder empty on Windows

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
luangs7
Posts: 12
Joined: 2017-06-01T17:26:02-07:00
Authentication code: 1151

Folder empty on Windows

Post by luangs7 »

So I'm working with TileView and I'm with some troubles.

When I follow this tutorial for Creating Tiles with this:

Code: Select all

   `   @echo off

 echo should already have original image in folder, as well as folders named 
 tiles and samples
 set basename=my_image_base_name
 set filename=my-image.jpg
 set extension=jpg

 set imagemagick=C:\Users\myuser\Desktop\image.jpg
 set /a tilesize=256
 set /a samplesize=500

 set tilesfolder=tiles
 set samplesfolder=samples

 echo create tile folders
 mkdir %tilesfolder%\%basename%
 mkdir %tilesfolder%\%basename%\1000
 mkdir %tilesfolder%\%basename%\500
 mkdir %tilesfolder%\%basename%\250
 mkdir %tilesfolder%\%basename%\125

 echo create half-sized versions for tiling (will be discarded later)
 %imagemagick% %filename% -resize 50%%  %basename%-500.%extension%
 %imagemagick% %filename% -resize 25%%  %basename%-250.%extension%
 %imagemagick% %filename% -resize 12.5%%  %basename%-125.%extension%
 echo create sample
 %imagemagick% %filename% -thumbnail %samplesize%x%samplesize%  
 ./%samplesfolder%/%filename%

 echo create tiles
 %imagemagick% %filename% -crop %tilesize%x%tilesize% -set filename:tile "%%
[fx:page.x/%tilesize%]_%%[fx:page.y/%tilesize%]" +repage +adjoin 
 "./%tilesfolder%/%basename%/1000/%%[filename:tile].%extension%"
 %imagemagick% %basename%-500.%extension% -crop %tilesize%x%tilesize% -set 
filename:tile "%%[fx:page.x/%tilesize%]_%%[fx:page.y/%tilesize%]" +repage 
+adjoin "./%tilesfolder%/%basename%/500/%%[filename:tile].%extension%"
%imagemagick% %basename%-250.%extension% -crop %tilesize%x%tilesize% -set 
filename:tile "%%[fx:page.x/%tilesize%]_%%[fx:page.y/%tilesize%]" +repage 
+adjoin "./%tilesfolder%/%basename%/250/%%[filename:tile].%extension%"
%imagemagick% %basename%-125.%extension% -crop %tilesize%x%tilesize% -set 
filename:tile "%%[fx:page.x/%tilesize%]_%%[fx:page.y/%tilesize%]" +repage 
+adjoin "./%tilesfolder%/%basename%/125/%%[filename:tile].%extension%"

 echo cleanup
del %tilesfolder%\%basename%-500.%extension%
del %tilesfolder%\%basename%-250.%extension%
del %tilesfolder%\%basename%-125.%extension%

echo DONE
 pause`
 
 
And after this, its creating empty folders. I cant find anything on Google and I need help, please
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Folder empty on Windows

Post by snibgo »

Your question is very vague. You don't seem to be running "convert" or "magick" or any other ImageMagick program.

Hint: when debugging, don't turn echo off.
snibgo's IM pages: im.snibgo.com
luangs7
Posts: 12
Joined: 2017-06-01T17:26:02-07:00
Authentication code: 1151

Re: Folder empty on Windows

Post by luangs7 »

snibgo wrote: 2017-06-01T17:40:04-07:00 Your question is very vague. You don't seem to be running "convert" or "magick" or any other ImageMagick program.

Hint: when debugging, don't turn echo off.
I just need to do it https://github.com/moagrius/TileView/wi ... ting-Tiles
User avatar
GeeMack
Posts: 718
Joined: 2015-12-01T22:09:46-07:00
Authentication code: 1151
Location: Central Illinois, USA

Re: Folder empty on Windows

Post by GeeMack »

luangs7 wrote: 2017-06-01T17:29:18-07:00When I follow this tutorial for Creating Tiles with this: [...] And after this, its creating empty folders. I cant find anything on Google and I need help, please
One very obvious problem is the variable that should hold the ImageMagick program name is holding an image file name.

Code: Select all

set imagemagick=C:\Users\myuser\Desktop\image.jpg

...

%imagemagick% %filename% -crop %tilesize%x%tilesize% ...

...
As snibgo mentioned, it doesn't look like you're running a "convert" or "magick" command at all.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Folder empty on Windows

Post by fmw42 »

set imagemagick=C:\Users\myuser\Desktop\image.jpg
is not calling the ImageMagick convert or magick as snibgo said above so your variable %imagemagick%, is referencing an image and not the convert or magick command. So you have variable to two different input images and no IM command when you do things like %imagemagick% %filename%. You need to define your %imagemagick% as the path to IM convert or magick depending upon whether you are on IM 6 or IM 7
luangs7
Posts: 12
Joined: 2017-06-01T17:26:02-07:00
Authentication code: 1151

Re: Folder empty on Windows

Post by luangs7 »

fmw42 wrote: 2017-06-01T18:24:04-07:00
set imagemagick=C:\Users\myuser\Desktop\image.jpg
is not calling the ImageMagick convert or magick as snibgo said above so your variable %imagemagick%, is referencing an image and not the convert or magick command. So you have variable to two different input images and no IM command when you do things like %imagemagick% %filename%. You need to define your %imagemagick% as the path to IM convert or magick depending upon whether you are on IM 6 or IM 7
So in case of the image that I want to slice, I dont define anyware?
luangs7
Posts: 12
Joined: 2017-06-01T17:26:02-07:00
Authentication code: 1151

Re: Folder empty on Windows

Post by luangs7 »

Okay, now I changed the variable %imagemagick% to "..Desktop\ImageMagick-7.0.5-Q16\magick"
And the console give me the error:

Code: Select all

 %imagemagick% %filename% -thumbnail %samplesize%x%samplesize%  ./%samplesfolder%/%filename%
magick: UnableToOpenConfigureFile `magic.xml' @ warning/configure.c/GetConfigureOptions/715.
magick: UnableToOpenConfigureFile `delegates.xml' @ warning/configure.c/GetConfigureOptions/715.
magick: UnableToOpenModuleFile 'C:\Program Files\ImageMagick-7.0.5-Q16\modules\coders\IM_MOD_RL_JPEG_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/667.
magick: NoDecodeDelegateForThisImageFormat `JPEG' @ error/constitute.c/ReadImage/509.
magick: NoImageForProperty "%w" @ warning/property.c/GetMagickPropertyLetter/2561.
magick: UnknownImageProperty "%w" @ warning/property.c/InterpretImageProperties/3499.
magick: NoImageForProperty "%h" @ warning/property.c/GetMagickPropertyLetter/2449.
magick: UnknownImageProperty "%h" @ warning/property.c/InterpretImageProperties/3499.
magick: NoImageForProperty "%m" @ warning/property.c/GetMagickPropertyLetter/2480.
magick: UnknownImageProperty "%m" @ warning/property.c/InterpretImageProperties/3499.

C:\Users\luan2\Desktop>
C:\Users\luan2\Desktop>echo create tiles
create tiles

C:\Users\luan2\Desktop>%imagemagick% %filename% -crop %tilesize%x%tilesize% -set filename:tile "%%[fx:page.x/%tilesize%]_%%[fx:page.y/%tilesize%]" +repage +adjoin "./%tilesfolder%/%basename%/1000/%%[filename:tile].%extension%"
magick: UnableToOpenConfigureFile `magic.xml' @ warning/configure.c/GetConfigureOptions/715.
magick: UnableToOpenConfigureFile `delegates.xml' @ warning/configure.c/GetConfigureOptions/715.
magick: UnableToOpenModuleFile 'C:\Program Files\ImageMagick-7.0.5-Q16\modules\coders\IM_MOD_RL_JPEG_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/667.
magick: NoDecodeDelegateForThisImageFormat `JPEG' @ error/constitute.c/ReadImage/509.
magick: NoImageForProperty "%w" @ warning/property.c/GetMagickPropertyLetter/2561.
magick: UnknownImageProperty "%w" @ warning/property.c/InterpretImageProperties/3499.
magick: NoImageForProperty "%h" @ warning/property.c/GetMagickPropertyLetter/2449.
magick: UnknownImageProperty "%h" @ warning/property.c/InterpretImageProperties/3499.
magick: NoImageForProperty "%m" @ warning/property.c/GetMagickPropertyLetter/2480.
magick: UnknownImageProperty "%m" @ warning/property.c/InterpretImageProperties/3499.

C:\Users\luan2\Desktop>%imagemagick% %basename%-500.%extension% -crop %tilesize%x%tilesize% -set filename:tile "%%[fx:page.x/%tilesize%]_%%[fx:page.y/%tilesize%]" +repage +adjoin "./%tilesfolder%/%basename%/500/%%[filename:tile].%extension%"
magick: UnableToOpenConfigureFile `magic.xml' @ warning/configure.c/GetConfigureOptions/715.
magick: UnableToOpenBlob 'image-500.jpg': No such file or directory @ error/blob.c/OpenBlob/3094.
magick: UnableToOpenConfigureFile `delegates.xml' @ warning/configure.c/GetConfigureOptions/715.
magick: UnableToOpenBlob 'image-500.jpg': No such file or directory @ error/blob.c/OpenBlob/3094.
magick: UnableToOpenModuleFile 'C:\Program Files\ImageMagick-7.0.5-Q16\modules\coders\IM_MOD_RL_JPEG_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/667.
magick: NoDecodeDelegateForThisImageFormat `JPG' @ error/constitute.c/ReadImage/509.
magick: NoImageForProperty "%w" @ warning/property.c/GetMagickPropertyLetter/2561.
magick: UnknownImageProperty "%w" @ warning/property.c/InterpretImageProperties/3499.
magick: NoImageForProperty "%h" @ warning/property.c/GetMagickPropertyLetter/2449.
magick: UnknownImageProperty "%h" @ warning/property.c/InterpretImageProperties/3499.
magick: NoImageForProperty "%m" @ warning/property.c/GetMagickPropertyLetter/2480.
magick: UnknownImageProperty "%m" @ warning/property.c/InterpretImageProperties/3499.

C:\Users\luan2\Desktop>%imagemagick% %basename%-250.%extension% -crop %tilesize%x%tilesize% -set filename:tile "%%[fx:page.x/%tilesize%]_%%[fx:page.y/%tilesize%]" +repage +adjoin "./%tilesfolder%/%basename%/250/%%[filename:tile].%extension%"
magick: UnableToOpenConfigureFile `magic.xml' @ warning/configure.c/GetConfigureOptions/715.
magick: UnableToOpenBlob 'image-250.jpg': No such file or directory @ error/blob.c/OpenBlob/3094.
magick: UnableToOpenConfigureFile `delegates.xml' @ warning/configure.c/GetConfigureOptions/715.
magick: UnableToOpenBlob 'image-250.jpg': No such file or directory @ error/blob.c/OpenBlob/3094.
magick: UnableToOpenModuleFile 'C:\Program Files\ImageMagick-7.0.5-Q16\modules\coders\IM_MOD_RL_JPEG_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/667.
magick: NoDecodeDelegateForThisImageFormat `JPG' @ error/constitute.c/ReadImage/509.
magick: NoImageForProperty "%w" @ warning/property.c/GetMagickPropertyLetter/2561.
magick: UnknownImageProperty "%w" @ warning/property.c/InterpretImageProperties/3499.
magick: NoImageForProperty "%h" @ warning/property.c/GetMagickPropertyLetter/2449.
magick: UnknownImageProperty "%h" @ warning/property.c/InterpretImageProperties/3499.
magick: NoImageForProperty "%m" @ warning/property.c/GetMagickPropertyLetter/2480.
magick: UnknownImageProperty "%m" @ warning/property.c/InterpretImageProperties/3499.

C:\Users\luan2\Desktop>%imagemagick% %basename%-125.%extension% -crop %tilesize%x%tilesize% -set filename:tile "%%[fx:page.x/%tilesize%]_%%[fx:page.y/%tilesize%]" +repage +adjoin "./%tilesfolder%/%basename%/125/%%[filename:tile].%extension%"
magick: UnableToOpenConfigureFile `magic.xml' @ warning/configure.c/GetConfigureOptions/715.
magick: UnableToOpenBlob 'image-125.jpg': No such file or directory @ error/blob.c/OpenBlob/3094.
magick: UnableToOpenConfigureFile `delegates.xml' @ warning/configure.c/GetConfigureOptions/715.
magick: UnableToOpenBlob 'image-125.jpg': No such file or directory @ error/blob.c/OpenBlob/3094.
magick: UnableToOpenModuleFile 'C:\Program Files\ImageMagick-7.0.5-Q16\modules\coders\IM_MOD_RL_JPEG_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/667.
magick: NoDecodeDelegateForThisImageFormat `JPG' @ error/constitute.c/ReadImage/509.
magick: NoImageForProperty "%w" @ warning/property.c/GetMagickPropertyLetter/2561.
magick: UnknownImageProperty "%w" @ warning/property.c/InterpretImageProperties/3499.
magick: NoImageForProperty "%h" @ warning/property.c/GetMagickPropertyLetter/2449.
magick: UnknownImageProperty "%h" @ warning/property.c/InterpretImageProperties/3499.
magick: NoImageForProperty "%m" @ warning/property.c/GetMagickPropertyLetter/2480.
magick: UnknownImageProperty "%m" @ warning/property.c/InterpretImageProperties/3499. 
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Folder empty on Windows

Post by fmw42 »

You need to find where the actual binary of magick resides. It is not in your download folder. It is installed somewhere. I do not know where Windows installs it. But try

set imagemagick="magick.exe"

Does that work? If not you need to put the path to ImageMagick in your Windows Environment Path variable, if that is the correct place. Again I do not use Windows, so one of the Windows users will have to provide further instructions. But try my path above.

Did you install ImageMagick from binary or just download the source files?

See the binaries for Windows at http://www.imagemagick.org/script/binar ... hp#windows
luangs7
Posts: 12
Joined: 2017-06-01T17:26:02-07:00
Authentication code: 1151

Re: Folder empty on Windows

Post by luangs7 »

fmw42 wrote: 2017-06-01T19:06:07-07:00 You need to find where the actual binary of magick resides. It is not in your download folder. It is installed somewhere. I do not know where Windows installs it. But try

set imagemagick="magick.exe"

Does that work? If not you need to put the path to ImageMagick in your Windows Environment Path variable, if that is the correct place. Again I do not use Windows, so one of the Windows users will have to provide further instructions. But try my path above.

Did you install ImageMagick from binary or just download the source files?

See the binaries for Windows at http://www.imagemagick.org/script/binar ... hp#windows
Yeah, I installed the binary for Windows, and the command "magick" works fine. But with set imagemagick="magick.exe" show me the same error above
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Folder empty on Windows

Post by fmw42 »

Yeah, I installed the binary for Windows, and the command "magick" works fine. But with set imagemagick="magick.exe" show me the same error above
The try replacing magick.exe with just magick in your set command. If that does not work, then it is more complicated then I know and you will need help from a Windows user.

Does
magick logo: logo.jpg
work if you type it in a CMD window from your home directory. You should then see logo.jpg in that directory.
luangs7
Posts: 12
Joined: 2017-06-01T17:26:02-07:00
Authentication code: 1151

Re: Folder empty on Windows

Post by luangs7 »

fmw42 wrote: 2017-06-01T19:23:42-07:00
Yeah, I installed the binary for Windows, and the command "magick" works fine. But with set imagemagick="magick.exe" show me the same error above
The try replacing magick.exe with just magick in your set command. If that does not work, then it is more complicated then I know and you will need help from a Windows user.

Does
magick logo: logo.jpg
work if you type it in a CMD window from your home directory. You should then see logo.jpg in that directory.
yes, both magick.exe and magick are working fine

I have a Mac on virtual machine, the procedure is the same as windows for criating tiles?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Folder empty on Windows

Post by fmw42 »

Unix scripting is different from Windows scripting, but the basic ImageMagick commands are mostly the same. There are a few difference. See http://www.imagemagick.org/Usage/windows/.

But these should be the same

Unix:
magick logo: logo.jpg

Windows:
magick.exe logo: logo.jpg

The main difference are Windows needs double quotes and no escapes on parentheses. Most of the rest of the differences have to do with scripting.

I would try to make your commands work first in the CMD window with no variables. Then try adding variables slowly and keep testing to make sure it keeps working. You probably have some error in your scripting of variables. The definition of variables and the calling of the variables are quite different on Unix than Windows. I assume you are scripting in Windows because of the % symbols. But I really do not know how to set or use variables on Windows. Some Windows IM user will have to give you more help than I can do.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Folder empty on Windows

Post by fmw42 »

If you are on a Mac, can you script in Unix shell script. That I know.
luangs7
Posts: 12
Joined: 2017-06-01T17:26:02-07:00
Authentication code: 1151

Re: Folder empty on Windows

Post by luangs7 »

I dont know nothing about imagemagick and this things :(

All I know is this https://github.com/moagrius/TileView/wi ... ting-Tiles only because I need the tile of this images

Are there any other program similiar?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Folder empty on Windows

Post by snibgo »

What is the first command that fails? What is the error message?

You should then try that command in the command window. What happens then?

For example, the first IM command seems to be:

Code: Select all

%imagemagick% %filename% -resize 50%% %basename%-500.%extension%
Substituting the variables, and changing %% to %:

Code: Select all

magick my-image.jpg -resize 50% my_image_base_name-500.jpg
Does that command work? If not what is the error message? If it is "UnableToOpenConfigureFile" then you haven't installed IM properly.
snibgo's IM pages: im.snibgo.com
Post Reply