Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples with imagemagick conver return an error for any images #3557

Open
vladyslav2 opened this issue Nov 6, 2023 · 0 comments
Open

examples with imagemagick conver return an error for any images #3557

vladyslav2 opened this issue Nov 6, 2023 · 0 comments
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. stale: old Pull request is old and needs attention. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@vladyslav2
Copy link

vladyslav2 commented Nov 6, 2023

Thanks for stopping by to let us know something could be better!

In which file did you encounter the issue?

Trying to run this example https://github.com/GoogleCloudPlatform/golang-samples/blob/HEAD/functions/imagemagick/imagemagick.go and got stuck with an error convert-im6.q16: no decode delegate for this image format . At first I thought its a problem with an image and old convert on the google cloud. But more tests confirmed that all images getting the same error. Finally installing same convert version locally confirmed that problems aren't images itself.

Tried png, jpeg, jpg, heic, webp formats - all of them got same error message

Did you change the file? If so, how?

At first yes, but problem later confirmed problem with an original file

Describe the issue

  1. Deploy https://github.com/GoogleCloudPlatform/golang-samples/blob/HEAD/functions/imagemagick/imagemagick.go using this script:
gcloud functions deploy BlurOffensiveImages \
  --runtime go120 \
  --region=europe-central2 \
  --project=YOUR_PROJECT \
  --source=. \
  --entry-point=BlurOffensiveImages \
  --run-service-account=storage-file-transformer-ca@your_project.iam.gserviceaccount.com \
  --trigger-service-account=storage-file-transformer-ca@your_project.iam.gserviceaccount.com \
  --trigger-resource your-media-storage-bucket \
  --env-vars-file .env-file-with-thumb-storage.env \
  --trigger-event google.storage.object.finalize
  1. upload nude image on storage bucket
  2. check cloud func logs, you'll see an error log message
Function error: cmd.Run: exit status 1 convert-im6.q16: no decode delegate for this image format `' @ error/constitute.c/ReadImage/587.
convert-im6.q16: no images defined `-' @ error/convert.c/ConvertImageCommand/3229

Additional information

Obviously, image repo example zombie eating zombie give same error too

also, for some reason identity -list format returns an empty list for me, i.e.

formats := bytes.Buffer{}
formatsWriter := io.Writer(&formats)
cmd := exec.Command("identify", "-list", "format")
cmd.Stdout = formatsWriter
fmt.Printf("formats: %s\n", formats.String())

will echo nothing during cloud func execution.

Doing the same on my local machine will return huge list:

   Format  Module    Mode  Description
-------------------------------------------------------------------------------
      3FR  DNG       r--   Hasselblad CFV/H3D39II (0.21.1-Release)
      3G2  VIDEO     r--   Media Container
      3GP  VIDEO     r--   Media Container
      AAI* AAI       rw+   AAI Dune image
       AI  PDF       rw-   Adobe Illustrator CS2
     APNG  VIDEO     rw+   Animated Portable Network Graphics
      ART* ART       rw-   PFS: 1st Publisher Clip Art
      ARW  DNG       r--   Sony Alpha Raw Image Format (0.21.1-Release)
   ASHLAR* ASHLAR    -w+   Image sequence laid out in continuous irregular courses
      AVI  VIDEO     r--   Microsoft Audio/Visual Interleaved
     AVIF  HEIC      rw+   AV1 Image File Format (1.17.0)
      AVS* AVS       rw+   AVS X image
    BAYER* BAYER     rw+   Raw mosaiced samples
   BAYERA* BAYER     rw+   Raw mosaiced and alpha samples
      BGR* BGR       rw+   Raw blue, green, and red samples
     BGRA* BGR       rw+   Raw blue, green, red, and alpha samples
     BGRO* BGR       rw+   Raw blue, green, red, and opacity samples
      BMP* BMP       rw-   Microsoft Windows bitmap image
     BMP2* BMP       rw-   Microsoft Windows bitmap image (V2)
     BMP3* BMP       rw-   Microsoft Windows bitmap image (V3)
      BRF* BRAILLE   -w-   BRF ASCII Braille format
      CAL* CALS      rw-   Continuous Acquisition and Life-cycle Support Type 1
             Specified in MIL-R-28002 and MIL-PRF-28002
     CALS* CALS      rw-   Continuous Acquisition and Life-cycle Support Type 1
             Specified in MIL-R-28002 and MIL-PRF-28002
   CANVAS* XC        r--   Constant image uniform color
  CAPTION* CAPTION   r--   Caption
      CIN* CIN       rw-   Cineon Image File
      CIP* CIP       -w-   Cisco IP phone image format
     CLIP* CLIP      rw+   Image Clip Mask
     CMYK* CMYK    
     ....
     ```
@vladyslav2 vladyslav2 added priority: p2 Moderately-important priority. Fix may not be included in next release. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Nov 6, 2023
@product-auto-label product-auto-label bot added the samples Issues that are directly related to samples. label Nov 6, 2023
@subfuzion subfuzion added the stale: old Pull request is old and needs attention. label Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. samples Issues that are directly related to samples. stale: old Pull request is old and needs attention. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants
@subfuzion @vladyslav2 and others