Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 248FDF2BE for ; Wed, 3 Apr 2013 00:22:37 +0000 (UTC) Received: (qmail 12383 invoked by uid 500); 3 Apr 2013 00:22:35 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 12277 invoked by uid 500); 3 Apr 2013 00:22:35 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 12268 invoked by uid 99); 3 Apr 2013 00:22:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Apr 2013 00:22:35 +0000 X-ASF-Spam-Status: No, hits=3.2 required=5.0 tests=FORGED_YAHOO_RCVD,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [98.139.212.167] (HELO nm8.bullet.mail.bf1.yahoo.com) (98.139.212.167) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 03 Apr 2013 00:22:30 +0000 Received: from [98.139.215.140] by nm8.bullet.mail.bf1.yahoo.com with NNFMP; 03 Apr 2013 00:22:09 -0000 Received: from [98.139.211.197] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 03 Apr 2013 00:22:09 -0000 Received: from [127.0.0.1] by smtp206.mail.bf1.yahoo.com with NNFMP; 03 Apr 2013 00:22:09 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1364948529; bh=UnQfagoanngHcjPyNabP6ydptQl0jF6Uko/Nc3FYpss=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:From:Content-Type:Message-Id:Mime-Version:Subject:Date:References:To:In-Reply-To:X-Mailer; b=RhdR8ikSimCwtvCHHYQmCf/Ug1UVaO0oqetwbFSJFIzIo/vzKpA86L2PRnnIiOS9zgc/C3hh3kn0glGmM0WkAYw5aUxcvBSkq6nNvHPcfqnF5UOlfEH0Mpaa52WDqkSSDR+WZRCgQmqDYp8KncKfd72bOaNm5PQs9mf9LGH5UF0= X-Yahoo-Newman-Id: 149347.55609.bm@smtp206.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 5_q1Tk0VM1nBKaYvXI5725xTHeXDBNifjYi_ZQ_Q77mS_FL 7fWHCCBgWf1MZS4w0LshDsk12eAEzwCnkwspVcfoaEvPxF0KckxLdtLPU513 y1jxKXQMoY_TmsgTI63KOaG.CtDdbezFGAcc2rUc4ONjn.8s7Pu5EziVa0dy cynbA1unaYvGZTnhXuktk3mQQyNJ5FSkVIsNxGlkr3FtFish95bCeRBj5ew8 nhlMDBcAQowlsRs0JvZqmt2cbJzkrQcQxo3ZQjQpQYwUW.lMcZyzGxdOivad ibDDzhztRUO5CuiLiaM7n2Z2oMmcbZpriK4tXZgAZ6Ap3S5pS1haza0KbrW9 n4alAmggrOdStSDm_P6YyPlWicGeXnTXQUi8gNObnftddEXsDy6I7HLrh44Q ZSIDQMz2esbDaoPI0co4NsoQQTqwaHsosT_vWEUUSFfrn8fhL3Y3WhNLhqtP fstyFDgfSmlmAIKPV7HKCqDmYcSG7RnhlUeaf6eZtpAx8UaIRfZNcM55.Pat e3M7GW02HIQ0IuTze.HsXTObeTTheE_IAUof10hTqmmoV2eFiqv5mGLiLRHJ ZyW8_T6XqC.VpgvagEVdgz7GYmZllzQDES6H3FAvWDhAAGw-- X-Yahoo-SMTP: b9FO.o6swBDjz1Oj2MrhmZVB01c- X-Rocket-Received: from [10.1.10.15] (iomatix@71.197.38.211 with plain) by smtp206.mail.bf1.yahoo.com with SMTP; 02 Apr 2013 17:22:08 -0700 PDT From: Jeff Charette Content-Type: multipart/alternative; boundary="Apple-Mail=_68863B59-3B0F-43FD-A75C-81F5848EF3A5" Message-Id: Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Connecting streams to cradle and couchdb attachments Date: Tue, 2 Apr 2013 20:22:07 -0400 References: To: user@couchdb.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1499) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_68863B59-3B0F-43FD-A75C-81F5848EF3A5 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 This is a nodejs question concerning couchdb attachments. It seems too = specific to post on stack overflow. I have 2 very long days into this = so any help is deeply appreciated! I am trying to connect a write stream from graphicsmagic to a readstream = in cradle in order to send a document I processed with graphics magic to = couchdb.=20 /* this makes the files, but loops infinitely */ = im(result.buffer, v.name) = .resize(s.width, s.height) = .autoOrient() = .write("./temp/" + s.width + 'x' + s.height + v.name, function (err) { = // <-- this is the write stream = if (!err) { = var attachmentData =3D { = name: s.width + 'x' + s.height + v.name, = 'Content-Type': v.type, = body: fs.readFileSync("./temp/" + s.width + 'x' + s.height + = v.name) // <-- this is the read stream = }; = db.saveAttachment(docId, attachmentData, function (err, reply) { = if (err) { = console.log(err) = return = } = console.log(reply) = }); = } = }); Theses are the docs I am pulling from: https://github.com/aheckmann/gm https://github.com/cloudhead/cradle Is anyone doing this? Maybe doing it another way? I don't care whether = I use cradle or not just that I send the processed attachment to couch. Jeff Charette | Principal=20 We Are Charette web / identity / packaging m 415.298.2707 w wearecharette.com e jeffrey@wearecharette.com= --Apple-Mail=_68863B59-3B0F-43FD-A75C-81F5848EF3A5--