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

Fix bug where a single image path fails #3

Closed
wants to merge 1 commit into from

Conversation

jbarciauskas
Copy link

  • Fix bug where a single image path fails
  • Slight improvement to error handling
  • Remove support for passing in an image directly, only support image paths

The following example currently results in a 400 error in the current code, and is fixed in this PR:

bs_post(
    text = 'Test photo.', 
    images = c('~/Downloads/profile-circle.jpg'),
    images_alt = c('test alt')) 

…ssing in an image directly, only support image paths
christopherkenny added a commit that referenced this pull request Mar 19, 2024
@christopherkenny
Copy link
Owner

Thanks @jbarciauskas. I gave this a quick look and it seems to be just a bug with unlisting a single entry (that is no longer needed). It's removed in 3805cb5. This fix avoids removing functionality vs the PR. Does that fix it for you?

devtools::load_all()
#> ℹ Loading bskyr
bs_post(
  text = 'Test of single image from path', 
  images = c(fs::path_package('bskyr', 'man/figures/logo.png')),
  images_alt = c('test alt: this is the same logo'),
) 
#> # A tibble: 1 × 2
#>   uri                                                                    cid    
#>   <chr>                                                                  <chr>  
#> 1 at://did:plc:5c2r73erhng4bszmxlfdtscf/app.bsky.feed.post/3knz65okibf2k bafyre…


blob <- bs_upload_blob(blob = fs::path_package('bskyr', 'man/figures/logo.png'),
                       clean = FALSE)
bs_post(
  text = 'Test of single image blob', 
  images = blob,
  images_alt = 'test alt: this is a logo with the word bskyr on a cloud on a blue background'
) 
#> # A tibble: 1 × 2
#>   uri                                                                    cid    
#>   <chr>                                                                  <chr>  
#> 1 at://did:plc:5c2r73erhng4bszmxlfdtscf/app.bsky.feed.post/3knz65pa3of2k bafyre…

Created on 2024-03-18 with reprex v2.1.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

Successfully merging this pull request may close these issues.

2 participants