{"action":"created","issue":{"url":"https://api.github.com/repos/qpdf/qpdf/issues/49","labels_url":"https://api.github.com/repos/qpdf/qpdf/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/qpdf/qpdf/issues/49/comments","events_url":"https://api.github.com/repos/qpdf/qpdf/issues/49/events","html_url":"https://github.com/qpdf/qpdf/issues/49","id":74834189,"number":49,"title":"libqpdf removes DecodeParms","user":{"login":"shirat74","id":8378674,"avatar_url":"https://avatars.githubusercontent.com/u/8378674?v=3","gravatar_id":"","url":"https://api.github.com/users/shirat74","html_url":"https://github.com/shirat74","followers_url":"https://api.github.com/users/shirat74/followers","following_url":"https://api.github.com/users/shirat74/following{/other_user}","gists_url":"https://api.github.com/users/shirat74/gists{/gist_id}","starred_url":"https://api.github.com/users/shirat74/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirat74/subscriptions","organizations_url":"https://api.github.com/users/shirat74/orgs","repos_url":"https://api.github.com/users/shirat74/repos","events_url":"https://api.github.com/users/shirat74/events{/privacy}","received_events_url":"https://api.github.com/users/shirat74/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-05-10T05:04:32Z","updated_at":"2015-05-16T14:32:10Z","closed_at":null,"body":"I'm currently writing a PNG to PDF converter program with libqpdf.\r\nI found that Flate compression predictor is quite useful for reducing file size.\r\nHowever, whenever I try to set parameters for Flate predictor with DecodeParms\r\ndictionary entry in Image dictionary, libqpdf removes it.\r\n\r\nIs there any way to set DecodeParms?"},"comment":{"url":"https://api.github.com/repos/qpdf/qpdf/issues/comments/102632714","html_url":"https://github.com/qpdf/qpdf/issues/49#issuecomment-102632714","issue_url":"https://api.github.com/repos/qpdf/qpdf/issues/49","id":102632714,"user":{"login":"shirat74","id":8378674,"avatar_url":"https://avatars.githubusercontent.com/u/8378674?v=3","gravatar_id":"","url":"https://api.github.com/users/shirat74","html_url":"https://github.com/shirat74","followers_url":"https://api.github.com/users/shirat74/followers","following_url":"https://api.github.com/users/shirat74/following{/other_user}","gists_url":"https://api.github.com/users/shirat74/gists{/gist_id}","starred_url":"https://api.github.com/users/shirat74/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shirat74/subscriptions","organizations_url":"https://api.github.com/users/shirat74/orgs","repos_url":"https://api.github.com/users/shirat74/repos","events_url":"https://api.github.com/users/shirat74/events{/privacy}","received_events_url":"https://api.github.com/users/shirat74/received_events","type":"User","site_admin":false},"created_at":"2015-05-16T14:32:10Z","updated_at":"2015-05-16T14:32:10Z","body":"Thank you for your help.\r\n\r\nIt would be nice if qpdf supports various predictor filters to be applied to stream data.\r\nBut I simply want to pass data which is already filtered via predictor function and let libqpdf do actual part of flate compression, thus I just want to notify libqpdf that data is filtered with predictor filter and /DecodeParms should not be removed. \r\n\r\nThe following change\r\n\r\n    --- QPDFWriter.cc.orig  2015-05-16 23:08:03 +0900\r\n    +++ QPDFWriter.cc       2015-05-16 23:08:22 +0900\r\n    @@ -1318,7 +1318,7 @@\r\n                     // We will supply our own filter and decode\r\n                     // parameters.\r\n                     object.removeKey(\"/Filter\");\r\n    -                object.removeKey(\"/DecodeParms\");\r\n    +                // object.removeKey(\"/DecodeParms\");\r\n                 }\r\n                 else\r\n                 {\r\n\r\nworks for me, but I don't know if there are side-effects.\r\n\r\nI will consider preparing sample data with various predictor function applied."}}