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

Remote Image Quality Issue and Config Inquiry #1366

Open
inturipravallika opened this issue Jan 8, 2025 · 0 comments
Open

Remote Image Quality Issue and Config Inquiry #1366

inturipravallika opened this issue Jan 8, 2025 · 0 comments

Comments

@inturipravallika
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant