Thursday, 2 May 2019

Firebase generate circle thumbnail fail with code 1

I tried to use ImageMagick to convert Image upload from My App to Firebase by Cloud Functions.

return spawn("convert", [
    tempFilePath,
    "(",
    "-size", 
    dim + "x" + dim, 
    "xc:black",
    "-fill",
    "white",
    "-draw",
    "\"circle",
    dim2 + "," + dim2,
    dim2 + "," + dim1+"\"",
    ")",
    "-alpha",
    "off",
    "-gravity",
    "center",
    "-compose",
    "copy_opacity",
    "-composite",
    "-crop",
    dim+"x"+dim+"+0+0",
    "-thumbnail",
    "300x300>",
    tempFilePathPNG
  ]); 

with dim and dim2 is my specific dimension. But when I use that function, the error appear and I don't know how. You can check the image below.

`convert /tmp/7eee6327-8b7a-41f8-a1a2-19bbc3f297c2.jpg ( -size 2592x2592 xc:black -fill white -draw "circle 1296,1296 1296,2591" ) -alpha off -gravity center -compose copy_opacity -composite -crop 2592x2592+0+0 -thumbnail 300x300> /tmp/7eee6327-8b7a-41f8-a1a2-19bbc3f297c2.png` failed with code 1

I also try others generate like only resize and draw image and it success. But this code above is fail always. Please help me. enter image description here



from Firebase generate circle thumbnail fail with code 1

No comments:

Post a Comment