-
-
Notifications
You must be signed in to change notification settings - Fork 726
openslideload_source: flag operation as "nocache" #4641
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
openslideload_source: flag operation as "nocache" #4641
Conversation
See commit cb58d7d for rationale.
|
Found by this (not yet committed) change in NetVips: --- a/samples/NetVips.Samples/Samples/GenerateImageClass.cs
+++ b/samples/NetVips.Samples/Samples/GenerateImageClass.cs
@@ -156,7 +156,8 @@ private string GenerateFunction(string operationName, string indent = "
bool mutable = false, IReadOnlyList<Introspect.Argument> outParameters = null)
{
using var op = Operation.NewFromName(operationName);
- if ((op.GetFlags() & Enums.OperationFlags.DEPRECATED) != 0)
+ var flags = op.GetFlags();
+ if ((flags & Enums.OperationFlags.DEPRECATED) != 0)
{
throw new ArgumentException($"No such operator. Operator \"{operationName}\" is deprecated");
}
@@ -172,8 +173,8 @@ private string GenerateFunction(string operationName, string indent = "
// we are only interested in non-deprecated args
var optionalInput = intro.OptionalInput
.Where(arg => (arg.Value.Flags & Enums.ArgumentFlags.DEPRECATED) == 0)
- // Drop "revalidate" option from source and buffer loaders as they are already uncached
- .Where(arg => arg.Key != "revalidate" || (firstArgType != GValue.SourceType && firstArgType != GValue.BlobType))
+ // Drop "revalidate" option from buffer loaders and operations marked "nocache" as they are already uncached
+ .Where(arg => arg.Key != "revalidate" || ((flags & Enums.OperationFlags.NOCACHE) == 0 && firstArgType != GValue.BlobType))
.Select(x => x.Value)
.ToArray();
var optionalOutput = intro.OptionalOutput |
|
That's annoying. How about adding this to operation.c: static void
vips_operation_summary_class(VipsObjectClass *object_class, VipsBuf *buf)
{
VipsOperationClass *operation_class = VIPS_OPERATION_CLASS(object_class);
VIPS_OBJECT_CLASS(vips_operation_parent_class)
->summary_class(object_class, buf);
GType gtype = G_OBJECT_CLASS_TYPE(operation_class);
if (!G_TYPE_IS_ABSTRACT(gtype) &&
operation_class->flags & VIPS_OPERATION_NOCACHE)
vips_buf_appendf(buf, ", nocache");
}Now And we can test that every source loader is tagged correctly with: (before this PR, of course hehe) |
|
Good idea! Let's do that as a follow-up. |
|
What should we do about your netvips commit? Do you think |
|
I'll apply that NetVips commit when regenerating the methods for libvips 8.18. I'm not sure there's much benefit to moving the |
|
OK, let's merge then! |
See commit cb58d7d for rationale.
History:
Commit 1214f94 moved this flag to the base class, and commit 53db48d later removed it, likely under the assumption that the
_sourceclass still had this flag set.Targets the 8.17 branch.