ฉันจะค้นหาโฟลเดอร์ imagemagick temp ใน linux ได้อย่างไร

ฉันยังใหม่กับ Imagemagick และ linux ฉันจะค้นหาโฟลเดอร์ temp ของใน linux ได้อย่างไร ฉันใช้ Imagemagick กับ liferay

$ ll
-rwxrwxrwx 1 root root 24332 Jun  3 05:56 a.pdf convert a.pdf -debug coder a.jpg Error: /syntaxerror in -file- Operand stack:

Execution stack:    %interp_exit   .runexec2   --nostringval--  
--nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1894   1   3   %oparray_pop   1893   1   3   %oparray_pop   1877   1   3   %oparray_pop   1771   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2  
--nostringval--   --nostringval--   --nostringval--   2   %stopped_push Dictionary stack:    --dict:1165/1684(ro)(G)--  
--dict:0/20(G)--   --dict:77/200(L)-- Current allocation mode is local Current file position is 57 GPL Ghostscript 9.06: Unrecoverable error, exit code 1 convert: Postscript delegate failed `a.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/678. convert: no images defined `a.jpg' @ error/convert.c/ConvertImageCommand/3046.

person Tushar Patel    schedule 07.07.2016    source แหล่งที่มา


คำตอบ (1)


วิธีที่ง่ายที่สุดคือค้นหาตัวแปรสภาพแวดล้อมที่คุณได้ตั้งค่าไว้ เช่น:

  • MAGICK_TEMPORARY_PATH
  • MAGICK_TMPDIR

โดยการวิ่ง:

env | grep -i MAGICK

มิฉะนั้น หากคุณไม่ได้ตั้งค่าตัวแปรสภาพแวดล้อมใดๆ ให้ดำเนินการบางอย่างที่จะบังคับให้ ImageMagick ใช้ดิสก์ ตัวอย่างเช่น:

convert -debug cache -limit memory 0 xc:black null:
2016-07-07T16:28:17+01:00 0:00.000 0.000u 6.9.5 Cache convert[55942]: cache.c/SetPixelCacheExtent/3737/Cache
  extend black[0] (/var/tmp/magick-55942ZyrN1AO8SfVA[3], disk, 8B)
2016-07-07T16:28:17+01:00 0:00.000 0.000u 6.9.5 Cache convert[55942]: cache.c/OpenPixelCache/4020/Cache
  open black[0] (/var/tmp/magick-55942ZyrN1AO8SfVA[-1], Map, 1x1 8B)
2016-07-07T16:28:17+01:00 0:00.010 0.000u 6.9.5 Cache convert[55942]: cache.c/DestroyPixelCache/1121/Cache
  destroy black[0]

นั่นแสดงให้คุณเห็นว่าเครื่องของฉันกำลังใช้งาน /var/tmp

person Mark Setchell    schedule 07.07.2016
comment
ขอบคุณนายที่ตอบคำถามของฉัน สิ่งแวดล้อม | grep -i MAGICK ให้ไม่มีเอาต์พุตหมายความว่าไม่ได้ตั้งค่าตัวแปรสภาพแวดล้อมสำหรับเครื่องของฉัน - person Tushar Patel; 08.07.2016
comment
แปลง -debug cache - หน่วยความจำ จำกัด 0 xc: black null: 2016-07-08T05:23:14+00:00 0:00.010 0.000u 6.7.8 การแปลงแคช [5533]: cache.c/ExtendCache/3953/Cache ขยาย สีดำ[0] (/tmp/magick-0JRaxgjj[3], ดิสก์, 8B) 2016-07-08T05:23:14+00:00 0:00.010 0.000u 6.7.8 การแปลงแคช [5533]: cache.c/ OpenPixelCache/4151/Cache เปิดสีดำ[0] (/tmp/magick-0JRaxgjj[-1] แมปหน่วยความจำ 1x1 8B) 2016-07-08T05:23:14+00:00 0:00.020 0.000u 6.7.8 การแปลงแคช [5533]: cache.c/DestroyPixelCache/1448/แคชทำลายสีดำ[0] - person Tushar Patel; 08.07.2016
comment
เครื่องของฉันใช้ /tmp/ เป็นโฟลเดอร์ชั่วคราว - person Tushar Patel; 08.07.2016
comment
ปัญหาของฉันคือมันไม่ได้สร้างการแสดงตัวอย่างสำหรับไฟล์ PDF ไฟล์อื่น ๆ ทั้งหมด แต่กำลังสร้างการแสดงตัวอย่าง - person Tushar Patel; 08.07.2016
comment
@TusharPatel คุณต้องติดตั้ง ghostscript หากคุณต้องการจัดการไฟล์ PDF - person Mark Setchell; 08.07.2016
comment
ใช่ครับ ติดตั้งสคริปต์ sir ghost ด้วย - person Tushar Patel; 08.07.2016
comment
ghostscript ใดส่งคืน /usr/bin/ghostscript - person Tushar Patel; 08.07.2016
comment
ตรวจสอบบทความที่ยอดเยี่ยมของ @KurtPfeifle ใน ghostscript และ delegates ที่นี่... stackoverflow.com/a/11418073/2836621 - person Mark Setchell; 08.07.2016
comment
$ ll -rwxrwxrwx 1 รูท รูท 24332 3 มิ.ย. 05:56 a.pdf - person Tushar Patel; 08.07.2016
comment
สแต็กการดำเนินการ: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1894 1 3 %oparray_pop 1893 1 3 %oparray_pop 1877 1 3 %oparray_pop 1771 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push พจนานุกรมสแต็ก: - person Tushar Patel; 08.07.2016
comment
--dict:1165/1684(ro)(G)-- --dict:0/20(G)-- --dict:77/200(L)-- โหมดการจัดสรรปัจจุบันเป็นแบบโลคัล - person Tushar Patel; 08.07.2016
comment
ตำแหน่งไฟล์ปัจจุบันคือ 57 GPL Ghostscript 9.06: ข้อผิดพลาดที่ไม่สามารถกู้คืนได้ รหัสออก 1 แปลง: การมอบหมาย Postscript ล้มเหลว a.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/678. convert: no images defined a.jpg ' @ error/convert.c/ConvertImageCommand/3046 - person Tushar Patel; 08.07.2016