Ошибка при вызове imagemagick с командной строкой 1с документооборот

Перейти к контенту

Доброго всем надо уменьшить размер картинки из 1С8 запускаю из командной строки C:ImageMagickmogrify -resize 50% E: mp mpfile.jpg все работает КомандаСистемы («C:ImageMagickmogrify -resize 50% E: mp mpfile.jpg») нивкакую ((( уже и кавычек пробовал тыкать везде где можно, и в путях и в ключах сделал bat файл C:ImageMagickmogrify -resize 50%% E: mp mpfile.jpg pause запускаю из ОС — работает запускаю из 1С — нифига пишет в окне bat unable to load module <путь>IM_MOD_RL_JPEG.dll — не найден указанный модуль. по пути пробежался глазками — модуль на месте что за засада то? (((

IrfanView достаточно удобен для этого

Не понятно — почему ссылка не на екзешник?

КомандаСистемы(«magick.exe convert «»C:ImageMagick est.jpg»» -resize 50% «»C:ImageMagick est_new.jpg»»», «»»C:ImageMagick»»»); У 1С должен быть доступ к каталогу.

— тоже самое да и обернуто все в бат-файл. из ОС работает из 1С нет

тоже никаких изменений ни ошибок ничего блин не пишет. просто отрабатывает и ничего с файлом не меняется. когда в bat обернуто хоть видно было что с ошибкой «модульне найден» работает. он даже new файл не создал

запуститьприложение( с параметром ожидатьзавершения добавить каталог imagemagick в path или указывать рабочий каталог как параметр запуститьприложение

яяяятьььь!!!!! 3 часа бьюсь лбом об стену перезапустил 1С — все работает как в и из 1с и из ОС

Тэги:

Комментарии доступны только авторизированным пользователям

Добрый день!

После установки 1C сервера 8.2.17 на ALT Linux 7.0 Centaurus, при попытке открыть БД клиентом, выдается: «ошибка инициализации графической подсистемы»

Пакет 1с-preinstall установлен, но скрипт ./config_server все равно не хочет видеть либы ImageMagick, хотя визуально они есть.

Кто-нибудь сталкивался?

« Последнее редактирование: 28.11.2013 18:16:48 от ros_t »


Записан


Отвечу сам себе:
Помог вот этот пост: http://www.1c-pro.ru/topic47243.html

Собственно, сделал симлинк (дословно):

ln -s /usr/lib64/libMagickWand-6.Q16.so.1 /usr/lib64/libWand.so
не забудьте перезапустить:

/etc/init.d/srv1cv82 restart
Всем спасибо, все молодцы!


Записан



Записан

Андрей Черепанов (cas@)


Хм, жаль мне это руководство не попалось сразу, хотя вопрос изучал с неделю точно. Собственно по этому ALT и выбрал.

Да, симлинк /usr/lib64/libWand.so.1 присутствовал. Но проблема ушла, пока топорно не сделал симлинк c именем libWand.so :)

Ну я в курсе, что лузер еще тот :))

Спасибо за ссылку на руководство, добавил в избранное.


Записан


Да, симлинк /usr/lib64/libWand.so.1 присутствовал. Но проблема ушла, пока топорно не сделал симлинк c именем libWand.so :)

Ну я в курсе, что лузер еще тот :))

Это не вы, это разработчики 1С такие… :)
Видно, недостаточно для новых версий 1С этого имени, надо ещё и libWand.so. Пойду добавлю.
Спасибо за информацию.


Записан

Андрей Черепанов (cas@)


Это не вы, это разработчики 1С такие… :)
Видно, недостаточно для новых версий 1С этого имени, надо ещё и libWand.so. Пойду добавлю.

Столкнулся с такой проблемой:
Поставил altlinux-7.0.4-centaurus-x86_64 сервер, но 1с сервер был только 32. Ключ у фирмы тоже только 32, поэтому выбора не было.  postgresql использовал для 64 версии.

Все заработало по инструкции. Но при первом обращении толстым клиентом на сервер, причем не в конфигурации, а кнопкой 1с, когда спрашиваются картинки стало ругаться что не хватает libWand.
Библиотеки были все на месте, симлинк скопированы. Но не работает.

Помогло:

apt-get install i586-libImageMagick
ln -s /usr/lib/libMagickWand*.so.1 /usr/lib/libWand.so.1
ln -s /usr/lib/libMagickWand*.so.1 /usr/lib/libWand.so

т.е. не хватило 586 библиотеки. Автоматом пакет 1c-preinstall не поставил и симплики не сделал.
 


Записан

Хочешь понять сам, объясни другому.
«Если уже все испробовал и ничего не помогает — почитай инструкцию»


i73

Posts: 50
Joined: 2016-08-24T18:30:27+00:00
Authentication code: 1151

Convert always returning exit code ‘1’

Hey, I am lost as to why my command is constantly returning ‘1’/»Failed» exit code even though it converts the texture.

Code: Select all

string.Format("convert "{0}" -depth 8 -resize {1}x{1} -sharpen 0x1.5 "{2}.png"", file, size, (file.Split('.')[0] + "_" + size)))

it’s basically «convert ‘image.png’ -resize 32 -sharpen 0x1.5 ‘ image_32.png»

Looking at ‘-Debug all’ I see no Exceptions or Errors in command line, is IM convert returning 1 a bug? Or am I overlooking something?

User avatar

fmw42

Posts: 25562
Joined: 2007-07-03T00:14:51+00:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert always returning exit code ‘1’

Post

by fmw42 » 2017-03-30T02:21:29+00:00

«convert ‘image.png’ -resize 32 -sharpen 0x1.5 ‘ image_32.png»

You seem to have a missing single quote at the end. It should be

Code: Select all

"convert 'image.png' -resize 32 -sharpen 0x1.5 ' image_32.png'"

Check your variables also to see they are evaluating as you expect.

If I do:

Code: Select all

convert logo: -resize 32 -sharpen 0x1.5 result.png
echo $?

0

So a return code of 0 is success. Thus a return code of 1 is failure/error.

snibgo

Posts: 12159
Joined: 2010-01-24T06:01:33+00:00
Authentication code: 1151
Location: England, UK

Re: Convert always returning exit code ‘1’

Post

by snibgo » 2017-03-30T12:08:27+00:00

How do you know convert is returning 1? The code shown merely sets a string. The command isn’t actually executed.

If it does return 1, you should printf the value of string. That might provide a clue.

Please say what version IM you are using.

i73

Posts: 50
Joined: 2016-08-24T18:30:27+00:00
Authentication code: 1151

Re: Convert always returning exit code ‘1’

Post

by i73 » 2017-03-30T17:07:20+00:00

fmw42 wrote: ↑2017-03-30T02:21:29+00:00

«convert ‘image.png’ -resize 32 -sharpen 0x1.5 ‘ image_32.png»

You seem to have a missing single quote at the end. It should be

Code: Select all

"convert 'image.png' -resize 32 -sharpen 0x1.5 ' image_32.png'"

Check your variables also to see they are evaluating as you expect.

If I do:

Code: Select all

convert logo: -resize 32 -sharpen 0x1.5 result.png
echo $?

0

So a return code of 0 is success. Thus a return code of 1 is failure/error.

Sorry my mistake, the

«convert ‘image.png’ -resize 32 -sharpen 0x1.5 ‘ image_32.png»

was just me writing out what I am trying to do, I’m not actually using that. The code I am using is in the <CODE> brace above it.

i73

Posts: 50
Joined: 2016-08-24T18:30:27+00:00
Authentication code: 1151

Re: Convert always returning exit code ‘1’

Post

by i73 » 2017-03-30T17:10:22+00:00

snibgo wrote: ↑2017-03-30T12:08:27+00:00
How do you know convert is returning 1? The code shown merely sets a string. The command isn’t actually executed.

If it does return 1, you should printf the value of string. That might provide a clue.

Please say what version IM you are using.

I know it’s returning a 1 because I have a listener waiting for any exceptions, I don’t understand how it converts the image but returns a 1.

I’m using the IM 6.8 library: ImageMagick-6.8.6-9-Q16-x86-dll

snibgo

Posts: 12159
Joined: 2010-01-24T06:01:33+00:00
Authentication code: 1151
Location: England, UK

Re: Convert always returning exit code ‘1’

Post

by snibgo » 2017-03-30T17:40:24+00:00

I’ve never known convert to return 1 when it shouldn’t. So perhaps your listener code may have a bug.

I suppose you have printed the value of the string when it returns 1. Then you can run that exact command from the command line, and see what it returns.

User avatar

fmw42

Posts: 25562
Joined: 2007-07-03T00:14:51+00:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert always returning exit code ‘1’

Post

by fmw42 » 2017-03-30T17:53:37+00:00

Perhaps the return 1 is not coming from Imagemagick, but from somewhere else in your code.

If you run the same command with variables resolve to their actual value from the command line, does that return 1 or 0?

i73

Posts: 50
Joined: 2016-08-24T18:30:27+00:00
Authentication code: 1151

Re: Convert always returning exit code ‘1’

Post

by i73 » 2017-03-30T19:52:19+00:00

snibgo wrote: ↑2017-03-30T17:40:24+00:00
I’ve never known convert to return 1 when it shouldn’t. So perhaps your listener code may have a bug.

I suppose you have printed the value of the string when it returns 1. Then you can run that exact command from the command line, and see what it returns.

Okay so now we’re getting somewhere, yes I now tossed in the exception and I am seeing errors…

This is my exception:

Failed to run with : ‘convert «C:Usersmy usera.png» -depth 8 -resize 128 -sharpen 0x1.5 «C:Usersmy usera_128.png»‘

When I input that into command:

Code: Select all

convert.exe: unable to open image `C:/Users/my user/Downloads/a.png': No such file or directory @ error/blob.c/OpenBlob/2643.
convert.exe: unable to open file `C:/Users/my user/Downloads/a.png' @ error/png.c/ReadPNGImage/3994.
convert.exe: no images defined `C:/Users/my user/Downloads/a_128.png' @ error/convert.c/ConvertImageCommand/3108.

I don’t know how it can both convert and open images while being unable to open all the images…

I already did try switching up my escape characters with forward and backwards slashes, mixed my quotations with single and double, any advice would help me out.

fmw42 wrote: ↑2017-03-30T17:53:37+00:00
Perhaps the return 1 is not coming from Imagemagick, but from somewhere else in your code.
If you run the same command with variables resolve to their actual value from the command line, does that return 1 or 0?

Yes I tried this already, from what I am putting into my .net code but now I am trying to call the exact line that I am outputting above ^.

User avatar

fmw42

Posts: 25562
Joined: 2007-07-03T00:14:51+00:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert always returning exit code ‘1’

Post

by fmw42 » 2017-03-30T20:00:15+00:00

Your error message says it is unable to open image:

C:/Users/my user/Downloads/a.png

but in Windows, you should be using and not /.

Where is it getting the /? Do IM error messages replace the with /? Sorry I am not a Windows user. So just checking to be sure you typed the correct syntax.

i73

Posts: 50
Joined: 2016-08-24T18:30:27+00:00
Authentication code: 1151

Re: Convert always returning exit code ‘1’

Post

by i73 » 2017-03-30T20:08:17+00:00

snibgo wrote: ↑2017-03-30T19:57:10+00:00
Those error messages didn’t come from that command. The directory names are different.

Yes sorry my mistake, I am typing these out since my outputs are on a Window, other than the directories it’s the exact same code (tried with both forward slashes and backslashes too).

fmw42 wrote: ↑2017-03-30T20:00:15+00:00
Your error message says it is unable to open image:

C:/Users/my user/Downloads/a.png

but in Windows, you should be using and not /.

Where is it getting the /? Do IM error messages replace the with /? Sorry I am not a Windows user. So just checking to be sure you typed the correct syntax.

No worries, I also tried in my c# to use both and / exact same issue with both of them.

Code: Select all

string command = string.Format("convert "{0}" -depth 8 -resize {1}x{1} -sharpen 0x1.5 "{2}.png"", file.Replace('', '/'), size, (file.Split('.')[0] + "_" + size).Replace('', '/'));

Do you guys know why I would get a failed to find image BUT still be able to convert?

Just want to thank you both for helping me out!

i73

Posts: 50
Joined: 2016-08-24T18:30:27+00:00
Authentication code: 1151

Re: Convert always returning exit code ‘1’

Post

by i73 » 2017-03-30T20:11:23+00:00

fmw42 wrote: ↑2017-03-30T20:02:30+00:00
Is convert.exe the IM convert or the Windows convert?

FFS! Yeah, we’re using convert.exe… I over looked that Just had to remove «convert»… Thank you guys so much for your time!!!!!

SOLVED (I’m dumb)

   trim89

17.07.17 — 08:21

Доброго времени суток.

Потребовалось конвертировать из pdf в jpg. Делаю с помощью ImageMagick. В cmd написал команду, все работает. Вызываю из 1с КомандаСистемы(Комманда) — не работает. Спустя какое то время решил запилить через bat файл. Батник формируется, работает при ручном запуске, но если сделать ЗапуститьПриложение(ПутьBAT), то результат нулевой.

В чем может быть проблема???

ПутьBAT = ПолучитьИмяВременногоФайла(«bat»);

врем = ПолучитьИмяВременногоФайла(«jpg»);

Текст   = Новый ЗаписьТекста(ПутьBAT, КодировкаТекста.OEM);

Текст.ЗаписатьСтроку(«»»c:Program FilesImageMagick-7.0.5-Q16magick.exe»» convert -density 600 «»»+ПутьКФайлу+»»» «»»+врем+»»»»);

Текст.Закрыть();

ЗапуститьПриложение(ПутьBAT);

   1dvd

1 — 17.07.17 — 08:22

в том, что код выполняется на сервере, а картинка на клиенте, например

   trim89

2 — 17.07.17 — 08:24

(1) Все выполняется на клиенте

   shamannk

3 — 17.07.17 — 08:25

(2) Ошибок нет?

   1dvd

4 — 17.07.17 — 08:25

(2) ну, тогда отладчиком проверь создается ли твой батник. Посмотри что он туда записывает и далее по логике

   trim89

5 — 17.07.17 — 08:26

(3) Нет, ничего не пишет

   shamannk

6 — 17.07.17 — 08:27

(5) Значит работает.

   trim89

7 — 17.07.17 — 08:27

(4) Батник создается, именно через отладчик путь к нему смотрел и его же запускал ручками. Все работает.

   1dvd

8 — 17.07.17 — 08:28

(7) а не работает в каком смысле? не создается файл врем?

   Рэйв

9 — 17.07.17 — 08:28

(0)Может результат просто не в той папке смотришь?

   trim89

10 — 17.07.17 — 08:30

(8) Да, не создается конвертированный файлик. Да и сам процесс конвертации происходит явно быстрее, чем должен.

   trim89

11 — 17.07.17 — 08:31

(9) все там

   1dvd

12 — 17.07.17 — 08:32

(11) Толстый клиент у тебя?

   trim89

13 — 17.07.17 — 08:33

(12) Тонкий

   1dvd

14 — 17.07.17 — 08:34

Результат = «»;

ЗапуститьПриложение(ПутьBAT, , , Результат);

Сообщить(«Результат = » + Результат);

   h-sp

15 — 17.07.17 — 08:34

(5) а как проверяешь?

   1dvd

16 — 17.07.17 — 08:34

(14) *

Результат = «»;

ЗапуститьПриложение(ПутьBAT, , Истина, Результат);

Сообщить(«Результат = » + Результат);

   trim89

17 — 17.07.17 — 08:36

(16) Вот именно так и сделал. Результат = 1, но файлик не создался.

   trim89

18 — 17.07.17 — 08:37

(15) Создался файлик да/нет =)

   1dvd

19 — 17.07.17 — 08:38

Текст   = Новый ЗаписьТекста(ПутьBAT, КодировкаТекста.OEM);

Текст.ЗаписатьСтроку(«»»c:Program FilesImageMagick-7.0.5-Q16magick.exe»» convert -density 600 «»»+ПутьКФайлу+»»» «»»+врем+»»»»);

Текст.ЗаписатьСтроку(«pause»);

Текст.Закрыть();

   trim89

20 — 17.07.17 — 08:42

(19) а вот это уже что-то. Пишет convert: unable to load module ‘C:Program FilesImageMagick-7.0.5-Q16modulescodersIM_MOD_RL_PNG_.dll’: Не найден указанный модуль.

@ error/module.c/OpenModule/1279.

convert: no decode delegate for this image format `PNG’ @ error/constitute.c/ReadImage/509.

   1dvd

21 — 17.07.17 — 08:42

(20) делай cd перед запуском конвертора

   trim89

22 — 17.07.17 — 08:46

(21) сделал cd C:, не помогло

   1dvd

23 — 17.07.17 — 08:48

(22) C:Program FilesImageMagick-7.0.5-Q16

   trim89

24 — 17.07.17 — 08:51

Заработало. Спасибо большое!

  

1dvd

25 — 17.07.17 — 08:52

Слава яйцам :)

Не знаю что делать, команда

convert -resize 500 -quality 100 X:1232Новая папка.jpg X:1232Новая папка.JPG

Выполняется в

ShellExecute(Handle, nil, 'cmd.exe', PChar('/K '+ ('convert -resize 500 -quality 100 X:1232Новая папка.jpg X:1232Новая папка.JPG') ), nil, SW_SHOW);

пишет ошибку в CMD
image
Выполняя напрямую в CMD эту команду вылетает та же ошибка, подскажите куда копать((

I have installed ImageMagick in my system (windows), and its commands are there in system PATH. Its working absolutely fine through Command line
I want to call the «convert» function of ImageMagick from Matlab using system command.
‘C:UsersVivek’ is the Path to image. I have to test working of ImageMagick through Matlab, as i need it in further processing (Making input suitable to Tesseract OCR)

    cmd= ['convert ' 'C:UsersVivek208.jpg ' 'C:UsersVivek208.png']
    system(cmd);

It says Invalid Parameter — C:UsersVivek208.png, I tried some other ways. But, all the time the problem is with the second parameters.

Need Help

Thanks

asked Apr 10, 2013 at 4:36

Vivek Vardhan's user avatar

Vivek VardhanVivek Vardhan

1,1083 gold badges21 silver badges43 bronze badges

4

Windows comes with its own convert program, and it looks like you’re calling that one because it’s first on the path in this context. It’s described here on ImageMagick’s site: http://www.imagemagick.org/Usage/windows/#convert_issue

I do not have ImageMagick installed, and I get the same error message when I try calling convert. That’s consistent with your code getting the wrong convert program.

C:Usersjanke>convert C:UsersVivek286.jpg C:UsersVivek208.png
Invalid Parameter - C:UsersVivek208.png

Specify the full path to ImageMagick’s convert program and it should work for you.

answered Apr 10, 2013 at 23:56

Andrew Janke's user avatar

Andrew JankeAndrew Janke

23.5k5 gold badges56 silver badges85 bronze badges

1

The solution mentioned in the last post is the standard way to solve the issue, but the simplest way to do this is to just rename the ImageMagick’s convert.exe file to something else, like convert1.exe, and use this filename in your scripts.

answered May 26, 2015 at 13:03

Mostafa's user avatar

MostafaMostafa

2196 silver badges19 bronze badges

Понравилась статья? Поделить с друзьями:
  • Ошибка при вызове конструктора конструктор запроса
  • Ошибка при вызове ifcplugin госуслуги
  • Ошибка при вызове конструктора ком объект
  • Ошибка при вызове ifcplugin signhashsimple ошибка не определена
  • Ошибка при вызове конструктора интернетпрокси