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

Update git URL for stb #117

Merged
merged 3 commits into from
Oct 31, 2023
Merged

Update git URL for stb #117

merged 3 commits into from
Oct 31, 2023

Conversation

amirtronics
Copy link
Contributor

Description of the change

stb library link needs to be updated as the old URL is nonexistent for stb_image_resize.h

@prabhuomkar
Copy link
Owner

@roboticswithamir can you try using the new stb_image_resize2.h and maybe update your PR?
Reference: https://github.com/nothings/stb/blob/master/stb_image_resize2.h

@amirtronics
Copy link
Contributor Author

@prabhuomkar
I tried using this new stb_resize_2.h stbir_resize_uint8() has been removed in new release and we are left with only two options stbir_resize_uint8_srgb() and stbir_resize_uint8_srgb() which don't take depth as input.

@prabhuomkar
Copy link
Owner

@prabhuomkar I tried using this new stb_resize_2.h stbir_resize_uint8() has been removed in new release and we are left with only two options stbir_resize_uint8_srgb() and stbir_resize_uint8_srgb() which don't take depth as input.

@roboticswithamir i checked the comments of the code and I can see following guide to port to new APIs: https://github.com/nothings/stb/blob/master/stb_image_resize2.h#L19-L23
which says:

stbir_resize_uint8():
          - call `stbir_resize_uint8_linear`, cast channel count to `stbir_pixel_layout`

@mfl28
Copy link
Collaborator

mfl28 commented Oct 26, 2023

As @prabhuomkar mentioned, updating to stb_image_resize2.h is simple using the guide:

  • extern/CMakeLists.txt: Change "stb_image_resize" to "stb_image_resize2".
  • utils/image_io/CMakeLists.txt: Change stb-image-resize to stb-image-resize2 in target_link_libraries(...).
  • utils/image_io/src/image_io.cpp: Update the include to #include "stb_image_resize2.h", update the resizing code to
     stbir_resize_uint8_linear(image_raw.get(), width, height, 0,
         image_resized_buffer.data(), new_width, new_height, 0, static_cast<stbir_pixel_layout>(depth));

Also, thanks for bringing this issue to our attention @roboticswithamir !

@mfl28 mfl28 linked an issue Oct 26, 2023 that may be closed by this pull request
@prabhuomkar
Copy link
Owner

@roboticswithamir looking forward to the updated PR so that we can get it merged at earliest. Thanks.

@amirtronics
Copy link
Contributor Author

I've added a new commit and the PR is updated. It's working fine now.

STBIR_RGBA replaced with static_cast<stbir_pixel_layout>(depth)
@prabhuomkar prabhuomkar merged commit 2d4669c into prabhuomkar:master Oct 31, 2023
8 checks passed
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.

External stb image header no longer available [bug]
3 participants