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

api: deprecation cleanup in imageio.h #4312

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

cmake_minimum_required (VERSION 3.15)

set (OpenImageIO_VERSION "2.6.2.0")
set (OpenImageIO_VERSION "2.6.3.0")
set (OpenImageIO_VERSION_OVERRIDE "" CACHE STRING
"Version override (use with caution)!")
mark_as_advanced (OpenImageIO_VERSION_OVERRIDE)
Expand Down
6 changes: 3 additions & 3 deletions src/iconvert/iconvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,7 @@ convert_file(const std::string& in_filename, const std::string& out_filename)

bool ok = true;
bool mip_to_subimage_warning = false;
for (int subimage = 0; ok && in->seek_subimage(subimage, 0, inspec);
++subimage) {
for (int subimage = 0; ok && in->seek_subimage(subimage, 0); ++subimage) {
if (subimage > 0 && !out->supports("multiimage")) {
print(stderr,
"iconvert WARNING: {} does not support multiple subimages.\n"
Expand All @@ -388,6 +387,7 @@ convert_file(const std::string& in_filename, const std::string& out_filename)
int miplevel = 0;
do {
// Copy the spec, with possible change in format
inspec = in->spec(subimage, miplevel);
ImageSpec outspec = inspec;
bool nocopy = adjust_spec(in.get(), out.get(), inspec, outspec);
if (miplevel > 0) {
Expand Down Expand Up @@ -473,7 +473,7 @@ convert_file(const std::string& in_filename, const std::string& out_filename)
}

++miplevel;
} while (ok && in->seek_subimage(subimage, miplevel, inspec));
} while (ok && in->seek_subimage(subimage, miplevel));
}

out->close();
Expand Down
4 changes: 2 additions & 2 deletions src/igrep/igrep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ grep_file(const std::string& filename, std::regex& re,
std::cerr << geterror() << "\n";
return false;
}
ImageSpec spec = in->spec();

if (file_match) {
bool match = false;
Expand All @@ -83,6 +82,7 @@ grep_file(const std::string& filename, std::regex& re,
do {
if (!all_subimages && subimage > 0)
break;
ImageSpec spec = in->spec(subimage);
for (auto&& p : spec.extra_attribs) {
TypeDesc t = p.type();
if (t.elementtype() == TypeDesc::STRING) {
Expand All @@ -108,7 +108,7 @@ grep_file(const std::string& filename, std::regex& re,
}
}
}
} while (in->seek_subimage(++subimage, 0, spec));
} while (in->seek_subimage(++subimage, 0));

if (invert_match) {
found = !found;
Expand Down
26 changes: 13 additions & 13 deletions src/iinfo/iinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,9 @@ static void
print_info_subimage(int current_subimage, int max_subimages, ImageSpec& spec,
ImageInput* input, const std::string& filename)
{
if (!input->seek_subimage(current_subimage, 0, spec))
if (!input->seek_subimage(current_subimage, 0))
return;
spec = input->spec(current_subimage);

if (!metamatch.empty()
&& !std::regex_search(
Expand Down Expand Up @@ -274,9 +275,9 @@ print_info_subimage(int current_subimage, int max_subimages, ImageSpec& spec,
print("\n");
}
// Count MIP levels
ImageSpec mipspec;
while (input->seek_subimage(current_subimage, nmip, mipspec)) {
while (input->seek_subimage(current_subimage, nmip)) {
if (printres) {
ImageSpec mipspec = input->spec_dimensions(current_subimage, nmip);
if (nmip == 1)
print(" MIP-map levels: {}x{}", spec.width, spec.height);
print(" {}x{}", mipspec.width, mipspec.height);
Expand All @@ -291,8 +292,7 @@ print_info_subimage(int current_subimage, int max_subimages, ImageSpec& spec,
if (filenameprefix)
print("{} : ", filename);
// Before sha-1, be sure to point back to the highest-res MIP level
ImageSpec tmpspec;
input->seek_subimage(current_subimage, 0, tmpspec);
input->seek_subimage(current_subimage, 0);
print_sha1(input, current_subimage, 0);
}

Expand All @@ -302,8 +302,7 @@ print_info_subimage(int current_subimage, int max_subimages, ImageSpec& spec,
if (compute_stats
&& (metamatch.empty() || std::regex_search("stats", field_re))) {
for (int m = 0; m < nmip; ++m) {
ImageSpec mipspec;
input->seek_subimage(current_subimage, m, mipspec);
ImageSpec mipspec = input->spec_dimensions(current_subimage, m);
if (filenameprefix)
print("{} : ", filename);
if (nmip > 1 && (subimages || m == 0)) {
Expand All @@ -314,7 +313,7 @@ print_info_subimage(int current_subimage, int max_subimages, ImageSpec& spec,
}
}

if (!input->seek_subimage(current_subimage, 0, spec))
if (!input->seek_subimage(current_subimage, 0))
return;
}

Expand All @@ -334,23 +333,24 @@ print_info(const std::string& filename, size_t namefieldlength,
std::vector<int> num_of_miplevels;
{
int nmip = 1;
while (input->seek_subimage(input->current_subimage(), nmip, spec)) {
while (input->seek_subimage(input->current_subimage(), nmip)) {
++nmip;
any_mipmapping = true;
}
num_of_miplevels.push_back(nmip);
}
while (input->seek_subimage(num_of_subimages, 0, spec)) {
while (input->seek_subimage(num_of_subimages, 0)) {
// maybe we should do this more gently?
++num_of_subimages;
int nmip = 1;
while (input->seek_subimage(input->current_subimage(), nmip, spec)) {
while (input->seek_subimage(input->current_subimage(), nmip)) {
++nmip;
any_mipmapping = true;
}
num_of_miplevels.push_back(nmip);
}
input->seek_subimage(0, 0, spec); // re-seek to the first
// input->seek_subimage(0, 0); // re-seek to the first
spec = input->spec(0, 0);

if (metamatch.empty()
|| std::regex_search("resolution, width, height, depth, channels",
Expand Down Expand Up @@ -388,7 +388,7 @@ print_info(const std::string& filename, size_t namefieldlength,
// info about num of subimages and their resolutions
print(" {} subimages: ", num_of_subimages);
for (int i = 0; i < num_of_subimages; ++i) {
input->seek_subimage(i, 0, spec);
spec = input->spec(i, 0);
int bits = spec.get_int_attribute("oiio:BitsPerSample",
spec.format.size() * 8);
if (i)
Expand Down
Loading
Loading