Skip to content

Remote Image Quality Issue and Config Inquiry #1366

@inturipravallika

Description

@inturipravallika

What Happened

When uploading images to Slack using the files.remote.update API, the image quality noticeably deteriorates. This reduction in quality is not observed when using other Slack file upload APIs like files.upload.
Is there any configuration or setting we can modify to preserve image quality during remote uploads?

Expected Behavior

Uploaded images should maintain their original quality, including resolution and sharpness.

Steps to Reproduce

  1. Use the files.upload API from Slack's messaging documentation (API link) to upload an image and observe the quality.
  2. Use files.remote.update API to update an image with the parameters provided below.
  3. Compare the image quality.

Reproducible Code

uploads := slack.UploadFileV2Parameters{
	Filetype:        "auto",
	Filename:        "Loading...",
	FileSize:        int(fileSize),
	Reader:          fileBuffer,
	Channels:        []string{n.BotEvent.ChannelID},
	Channel:         n.BotEvent.ChannelID,
	ThreadTimestamp: n.BotEvent.ThreadTimeStamp,
	Title:           appMentionTmpl.Title,
	//InitialComment:  appMentionTmpl.InitialComment,
}

uploadResp, er := n.Messenger.CompleteUploadExternal(ctx, uploads)

   payload := slack.RemoteFileParameters{
	ExternalID: s.uuidGenerator.New(),
	Title:      fmt.Sprintf("Model: %s", n.Data[ThreadWorksheetName]),
	// PreviewImage:       text,
	PreviewImageReader: nlsObject.Reader,
}
_, err = n.Messenger.UpdateRemoteFile(ctx, fileID, payload)
if err != nil {
	return fmt.Errorf("failed to update remote file: %w", err)
}

Versions

  • Go: v1.22.6
  • slack-go/slack:v0.14.0

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions