{"action":"created","issue":{"url":"https://api.github.com/repos/jcupitt/libvips/issues/310","labels_url":"https://api.github.com/repos/jcupitt/libvips/issues/310/labels{/name}","comments_url":"https://api.github.com/repos/jcupitt/libvips/issues/310/comments","events_url":"https://api.github.com/repos/jcupitt/libvips/issues/310/events","html_url":"https://github.com/jcupitt/libvips/issues/310","id":93227843,"number":310,"title":"Force python calculation before writing to file","user":{"login":"Jondeen","id":763025,"avatar_url":"https://avatars.githubusercontent.com/u/763025?v=3","gravatar_id":"","url":"https://api.github.com/users/Jondeen","html_url":"https://github.com/Jondeen","followers_url":"https://api.github.com/users/Jondeen/followers","following_url":"https://api.github.com/users/Jondeen/following{/other_user}","gists_url":"https://api.github.com/users/Jondeen/gists{/gist_id}","starred_url":"https://api.github.com/users/Jondeen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jondeen/subscriptions","organizations_url":"https://api.github.com/users/Jondeen/orgs","repos_url":"https://api.github.com/users/Jondeen/repos","events_url":"https://api.github.com/users/Jondeen/events{/privacy}","received_events_url":"https://api.github.com/users/Jondeen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-06T09:03:03Z","updated_at":"2015-07-06T10:31:25Z","closed_at":null,"body":"Hi,\r\n\r\nIn my infamous polygon-cutting script (updated here: https://gist.github.com/Jondeen/5a7043a7de7bf4cbdc4f#file-roicutterv2-py ) I attempt to cut down a big image to it's theoretical maximum size based on minimum and maximum values for the coordinates of the polygon, in advance of the polygon-coordinate testing.\r\n\r\nConsidering the lag I get on massive images here it seems as though the tests are all chained and performed on the full dataset(?) regardless of the `trim`-operation in the middle. Is there any way I can force the parser to recompile the image buffer after the trim operation?\r\n\r\nNaturally, I may have misunderstood the structure and nature of the chained operations, but I see few other reasons why the large files should differ so much from the smaller ones -- any enlightenment is much appreciated!"},"comment":{"url":"https://api.github.com/repos/jcupitt/libvips/issues/comments/118803911","html_url":"https://github.com/jcupitt/libvips/issues/310#issuecomment-118803911","issue_url":"https://api.github.com/repos/jcupitt/libvips/issues/310","id":118803911,"user":{"login":"jcupitt","id":580843,"avatar_url":"https://avatars.githubusercontent.com/u/580843?v=3","gravatar_id":"","url":"https://api.github.com/users/jcupitt","html_url":"https://github.com/jcupitt","followers_url":"https://api.github.com/users/jcupitt/followers","following_url":"https://api.github.com/users/jcupitt/following{/other_user}","gists_url":"https://api.github.com/users/jcupitt/gists{/gist_id}","starred_url":"https://api.github.com/users/jcupitt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcupitt/subscriptions","organizations_url":"https://api.github.com/users/jcupitt/orgs","repos_url":"https://api.github.com/users/jcupitt/repos","events_url":"https://api.github.com/users/jcupitt/events{/privacy}","received_events_url":"https://api.github.com/users/jcupitt/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T10:31:25Z","updated_at":"2015-07-06T10:31:25Z","body":"Ooop, sorry, I need to look at your masking script.\r\n\r\nIt's all on-demand, so it will only calculate the bits it needs for the final image. If you mask the whole file then crop out a bit of the mask and just write that, it'll only calculate that small part of the mask.\r\n\r\nIf you're seeing a long delay in startup, it could be openslide getting ready, or it could be the initial build of the pipeline, if it's very long. Source formats like tiff sometimes need converting before they can be processed, so you might be seeing a conversion delay. The `--vips-progress` flag is handy for seeing where vips is looping.\r\n\r\nYou can cache intermediate results, see vips_tilecache(). This can sometimes speed things up if you are getting a lot of recomputation. You can also write intermediates to memory images and reuse them. \r\n\r\nhttp://www.vips.ecs.soton.ac.uk/supported/current/doc/html/libvips/libvips-conversion.html#vips-tilecache"}}