# 导入后头像未显示

**URL:** https://meta.discourse.org/t/avatars-not-showing-after-import/80081
**Category:** Development
**Created:** [2018年二月8日 05:20 UTC](https://meta.discourse.org/t/avatars-not-showing-after-import/80081 "2018-02-08T05:20:44Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![fhe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fhe/32/113345_2.png) [@fhe](https://meta.discourse.org/u/fhe)
#### Post date: [2018年二月8日 05:20 UTC](https://meta.discourse.org/t/avatars-not-showing-after-import/80081/1 "2018-02-08T05:20:44Z")

</div>

I’m currently trying to import from IPB using a local dev environment on macOS without any virtualization.

I’m importing avatars via

```
upload = create_upload(user.id, img_path, File.basename(img_path))
if upload && upload.persisted?
    user.create_user_avatar
    user.user_avatar.update(custom_upload_id: upload.id)
    user.update(uploaded_avatar_id: upload.id)
else
    puts "Error: Upload did not persist #{img_path}!"
end

```

which creates the `upload`, creates the `user_avatar` and updates the `uploaded_avatar_id` for the user. However, the avatars are not showing after I import the user and after Sidekiq has processed all tasks.

The uploaded file also exists in the file system at  
discourse/public/uploads/default/original/1X/a164bb6a13a258a27996f117c21d58ceb9ae8a52.png  
and is referenced as  
[http://localhost:3000/user\_avatar/localhost/florian/64/2\_1.png](http://localhost:3000/user_avatar/localhost/florian/64/2_1.png)  
[http://localhost:3000/user\_avatar/localhost/florian/240/2\_1.png](http://localhost:3000/user_avatar/localhost/florian/240/2_1.png)

Any ideas on how to find more information on why the avatars are not showing?

---

<div class="post-metadata">

### Author: ![fhe](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fhe/32/113345_2.png) [@fhe](https://meta.discourse.org/u/fhe)
#### Post date: [2018年二月9日 09:31 UTC](https://meta.discourse.org/t/avatars-not-showing-after-import/80081/2 "2018-02-09T09:31:14Z")

</div>

Several imports later, I just wanted to give an update here: the version of the `convert` tool installed in my dev environment doesn’t support the `bicubic` interpolation method which is used in `app/models/optimized_image.rb`

I’ve found @marguerite’s post here, which helped me getting avatars to show up locally.

> [@Letter avatars still displayed after importing phpbb3 avatars](https://meta.discourse.org/t/letter-avatars-still-displayed-after-importing-phpbb3-avatars/69553/13):
>
> Changed ‘bicubic’ to ‘catrom’, it worked. So I patched app/models/optimized\_image.rb, and now everything works. Thank you guys wink
