libraw: Fix left-over from cleanup

Our internal builds do not build the `contrib/` sandboxes, so I didn't notice
the failing libraw build :-/

PiperOrigin-RevId: 453868469
Change-Id: Ic084b066197ace6f52c3e7ed541a811c501d20b1
This commit is contained in:
Christian Blichmann 2022-06-09 02:03:19 -07:00 committed by Copybara-Service
parent 95afede8a0
commit 4872ba6569
4 changed files with 9 additions and 7 deletions

View File

@ -28,7 +28,7 @@ if (NOT TARGET sapi::sapi)
EXCLUDE_FROM_ALL) EXCLUDE_FROM_ALL)
endif() endif()
FetchContent_Declare( libraw FetchContent_Declare(libraw
GIT_REPOSITORY https://github.com/LibRaw/LibRaw.git GIT_REPOSITORY https://github.com/LibRaw/LibRaw.git
GIT_TAG a077aac05190530f22af4254a1e31745876d007f # 2022-06-03 GIT_TAG a077aac05190530f22af4254a1e31745876d007f # 2022-06-03
) )

View File

@ -17,7 +17,8 @@ add_executable(sapi_minilibraw
../utils/utils_libraw.cc ../utils/utils_libraw.cc
) )
target_link_libraries(sapi_minilibraw target_link_libraries(sapi_minilibraw
PRIVATE sapi_libraw PRIVATE absl::strings
sapi_contrib::libraw
sapi::logging sapi::logging
sapi::sapi sapi::sapi
) )

View File

@ -17,7 +17,8 @@ add_executable(sapi_libraw_test
../utils/utils_libraw.cc ../utils/utils_libraw.cc
) )
target_link_libraries(sapi_libraw_test PRIVATE target_link_libraries(sapi_libraw_test PRIVATE
sapi_libraw absl::strings
sapi_contrib::libraw
sapi::test_main sapi::test_main
sapi::temp_file sapi::temp_file
) )

View File

@ -14,6 +14,7 @@
#include "contrib/libraw/utils/utils_libraw.h" #include "contrib/libraw/utils/utils_libraw.h"
#include "absl/strings/str_cat.h"
#include "contrib/libraw/sandboxed.h" #include "contrib/libraw/sandboxed.h"
absl::Status LibRaw::InitLibRaw() { absl::Status LibRaw::InitLibRaw() {
@ -124,10 +125,9 @@ absl::StatusOr<int> LibRaw::GetRawWidth() {
absl::StatusOr<unsigned int> LibRaw::GetCBlack(int channel) { absl::StatusOr<unsigned int> LibRaw::GetCBlack(int channel) {
SAPI_RETURN_IF_ERROR(CheckIsInit()); SAPI_RETURN_IF_ERROR(CheckIsInit());
if (channel < 0 || >= LIBRAW_CBLACK_SIZE) { if (channel < 0 || channel >= LIBRAW_CBLACK_SIZE) {
return absl::OutOfRangeError(absl::string_view( return absl::OutOfRangeError(absl::StrCat(
std::to_string(channel) + " is out of range for array with size " + channel, " is out of range for array with size ", LIBRAW_CBLACK_SIZE));
std::to_string(LIBRAW_CBLACK_SIZE)));
} }
return GetImgData().color.cblack[channel]; return GetImgData().color.cblack[channel];