Skip to content

Should unlist for a list of image-magick work like image_join? #406

@KaiAragaki

Description

@KaiAragaki

It's been alluded to previously (#158, #330), but there seems to be a certain amount of confusion with lists of images vs a vector of images. I was recently confused by this too, as I expected image_vector and image_list to yield similar results:

library(magick)
image_vector <- c(wizard, wizard)
image_list <- unlist(list(wizard, wizard))

image_vector
#> # A tibble: 2 × 7
#>   format width height colorspace matte filesize density
#>   <chr>  <int>  <int> <chr>      <lgl>    <int> <chr>  
#> 1 GIF      480    640 sRGB       FALSE    99674 72x72  
#> 2 GIF      480    640 sRGB       FALSE    99674 72x72  

image_list
#> [[1]]
#> # A tibble: 1 × 7
#>   format width height colorspace matte filesize density
#>   <chr>  <int>  <int> <chr>      <lgl>    <int> <chr>  
#> 1 GIF      480    640 sRGB       FALSE    99674 72x72  
#> 
#> [[2]]
#> # A tibble: 1 × 7
#>   format width height colorspace matte filesize density
#>   <chr>  <int>  <int> <chr>      <lgl>    <int> <chr>  
#> 1 GIF      480    640 sRGB       FALSE    99674 72x72  

image_join works great, but I found this behavior a little surprising.

Thanks for the great package!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions