Professional Web Applications Themes

copying/pasting images in MacOS X - Mac Programming

This is just out of curiosity. I'm wondering how copying and pasting of images in MacOS X works. I'm assuming that Cocoa applications put PDF data into the scrap when copying image data. And Carbon applications put PICT data into the scrap. What happens when a Carbon application wants to paste an image copied from a Cocoa application? Or vice versa? Does this just not work? That would seem like a bad idea. Or does the scrap manager somehow convert between these two formats? I'm on an older Mac, so I'm unable to verify what actually happens. And what about ...

  1. #1

    Default copying/pasting images in MacOS X

    This is just out of curiosity.

    I'm wondering how copying and pasting of images in MacOS X works.

    I'm assuming that Cocoa applications put PDF data into the scrap when
    copying image data.

    And Carbon applications put PICT data into the scrap.


    What happens when a Carbon application wants to paste an image copied
    from a Cocoa application? Or vice versa?


    Does this just not work? That would seem like a bad idea.

    Or does the scrap manager somehow convert between these two formats?


    I'm on an older Mac, so I'm unable to verify what actually happens.

    And what about something like Gimp, which is neither Carbon nor Cocoa?
    or is it?

    I apologize for my ignorance ;)

    --
    [email]gbeggsCanada.com[/email] [url]http://www3.mb.sympatico.ca/~gbeggs1/[/url]
    Gerry Guest

  2. #2

    Default Re: copying/pasting images in MacOS X

    In article <1g0ztxi.17vikm41pfs9m4N%gbeggsCanada.com>,
    [email]gbeggsCanada.com[/email] (Gerry) wrote:
    > This is just out of curiosity.
    >
    > I'm wondering how copying and pasting of images in MacOS X works.
    >
    > I'm assuming that Cocoa applications put PDF data into the scrap when
    > copying image data.
    >
    > And Carbon applications put PICT data into the scrap.
    Cocoa applications can put whatever kind of image they want onto the
    clipboard. PDF's available if it's appropriate, but TIFF, etc, are also
    readily available. Which format gets used is up to the developer. An
    application can also declare that it's able to provide several formats
    and then lazily provide just one of them, depending on the receiving
    application's needs.

    I'd presume Carbon has similar capabilities.

    --
    Tom "Tom" Harrington
    Macaroni, Automated System Maintenance for Mac OS X.
    Version 1.4: Best cleanup yet, gets files other tools miss.
    See [url]http://www.atomicbird.com/[/url]
    Tom Harrington Guest

  3. #3

    Default Re: copying/pasting images in MacOS X

    Tom Harrington <tphpcisys.no.spam.dammit.net> wrote:
    > I'd presume Carbon has similar capabilities.
    Yes. But the standard format (at least pre-MacOS X) has always been
    PICT.

    There should be one standard format to copy/paste image data. Otherwise,
    results are unpredictable.

    Some applications will be able to accept scrap data from certain
    applications but not from others.
    This is sounding more and more like Unix, and not like the Mac ;)

    --
    [email]gbeggsCanada.com[/email] [url]http://www3.mb.sympatico.ca/~gbeggs1/[/url]
    Gerry Guest

  4. #4

    Default Re: copying/pasting images in MacOS X

    In article <1g1102r.1ihjedh10antaaN%gbeggsCanada.com>,
    [email]gbeggsCanada.com[/email] (Gerry) wrote:
    > Tom Harrington <tphpcisys.no.spam.dammit.net> wrote:
    >
    > > I'd presume Carbon has similar capabilities.
    >
    > Yes. But the standard format (at least pre-MacOS X) has always been
    > PICT.
    >
    > There should be one standard format to copy/paste image data. Otherwise,
    > results are unpredictable.
    BS. If one application can provide TIFF data, and another application
    can accept it, why should they be required to convert to PICT (or
    indeed, to any other format) to make the transfer?
    > Some applications will be able to accept scrap data from certain
    > applications but not from others.
    This has always been the case, though, hasn't it?

    The Cocoa approach enables an application to say, at the time of copy,
    "here's a list of several data formats I can provide; tell me which
    one's needed and I'll supply it". When the paste occurs, the
    originating application learns what format is needed and provides it.
    The mismatch you predict only occurs if the two applications are
    fundamentally unable to share data formats, and if that's the case,
    enforcing a standard isn't going to help anything.

    Again, I presume Carbon has similar capabilities.
    > This is sounding more and more like Unix, and not like the Mac ;)
    If "like the Mac" means apps are required to coerce data into
    inappropriate formats for copy-and-paste to work, then "more like Unix"
    is an improvement.

    --
    Tom "Tom" Harrington
    Macaroni, Automated System Maintenance for Mac OS X.
    Version 1.4: Best cleanup yet, gets files other tools miss.
    See [url]http://www.atomicbird.com/[/url]
    Tom Harrington Guest

  5. #5

    Default Re: copying/pasting images in MacOS X

    In article <tph-0354AE.09410810092003localhost>,
    Tom Harrington <tphpcisys.no.spam.dammit.net> wrote:
    > In article <1g1102r.1ihjedh10antaaN%gbeggsCanada.com>,
    > [email]gbeggsCanada.com[/email] (Gerry) wrote:
    >
    > > Tom Harrington <tphpcisys.no.spam.dammit.net> wrote:
    > >
    > > > I'd presume Carbon has similar capabilities.
    > >
    > > Yes. But the standard format (at least pre-MacOS X) has always been
    > > PICT.
    > >
    > > There should be one standard format to copy/paste image data. Otherwise,
    > > results are unpredictable.
    >
    > BS. If one application can provide TIFF data, and another application
    > can accept it, why should they be required to convert to PICT (or
    > indeed, to any other format) to make the transfer?
    Both the scrapbook/clipboard/pasteboard/drag and drop in both Carbon and
    Cocoa provide mechanisms to allow multiple descriptions of given data
    formats.

    In addition, for all but the clipboard, these can be provided in a lazy
    manner -- not actually populated until requested.

    Also, PICT isn't a format really -- it's a container, and can within it
    hold TIFF, JPEG, etc images (anything that can be described via
    compression/decompression) in a lossless manner. So, it is perfectly
    reasonable for applications that provide TIFF to also package as PICT as
    one of the available data flavors.

    QuickTime provides facilies for both loading this image data into a PICT
    and also for "converting" it back out in a lossless manner (or actually
    converting it if it needed to be).
    > > Some applications will be able to accept scrap data from certain
    > > applications but not from others.
    >
    > This has always been the case, though, hasn't it?
    No. It has always been recommended that applications provide one or
    both of 'TEXT' and 'PICT' in addition to other formats (ie, styled text,
    TIFF, PNG, etc) for maximum ease of use by users.

    Applications that fail to do this will work with *less* other
    applications rather than more. In fact, it is exactly this problem that
    causes a few rather large and rather visible Cocoa applications from a
    rather large computer company to fail to be able to source image drags
    into other applications.
    Tom Dowdy Guest

  6. #6

    Default Re: copying/pasting images in MacOS X

    In article <1g1102r.1ihjedh10antaaN%gbeggsCanada.com>,
    [email]gbeggsCanada.com[/email] (Gerry) wrote:
    >Tom Harrington <tphpcisys.no.spam.dammit.net> wrote:
    >
    >> I'd presume Carbon has similar capabilities.
    >
    >Yes. But the standard format (at least pre-MacOS X) has always been
    >PICT.
    >
    >There should be one standard format to copy/paste image data. Otherwise,
    >results are unpredictable.
    Erm, no. Because there are lots of different things, all
    called images, and all with different abilities. For
    instance, some can handle transparency and some can't;
    some can handle positioning data expressed in floating-
    point coordinates and some can't; some contain data
    expressing how to represent the colours in different
    colour-spaces and some don't; some can handle ways to
    represent the same image at different resolutions and
    some can't.

    And some applications, which really care about incredible
    detail in pictures, do different things when supplied with
    pictures in different image formats whereas others which
    handle pictures in a quick-and-dirty manner just always
    ask for one format.

    So the pasteboard system doesn't work the way you describe.
    Instead, the application supplying the data can supply it
    in any number of formats and the application which uses
    the data can consult the list of available formats and pick
    which one it likes best.

    And that's why I can apparently paste a graphic containing
    text into a well-written text-only application and get the
    actual text out of it.
    > This is sounding more and more
    > like Unix, and not like the Mac ;)
    No, it's flexible and does its best to use all available
    data to do what the user wants. It's Mac-ish.


    Simon Slavin Guest

  7. #7

    Default Re: copying/pasting images in MacOS X

    In article <1g139b1.4y1op3exzvimN%gbeggsCanada.com>,
    [email]gbeggsCanada.com[/email] (Gerry) wrote:
    >Tom Harrington <tphpcisys.no.spam.dammit.net> wrote:
    >
    >> BS. If one application can provide TIFF data, and another application
    >> can accept it, why should they be required to convert to PICT (or
    >> indeed, to any other format) to make the transfer?
    >
    >Because only if there is one standard format can we assume that
    >copy/pastes will work with all applications which support image data.
    There is no one thing that is image data. Are you going to set
    a new standard that you demand that everyone should keep to ?
    Is your standard going to deal with all the huge number of things
    that the different existing standards can handle ?
    >Other formats can be provided in addition to the standard format for
    >those applications which support them, but there should be a base format
    >supported by all.
    >
    >Without a standard format, there could be any combination of formats
    >provided. But unless another application decides to support at least one
    >of those formats, it won't work (when it should).
    Pretty much any application which copies or pastes images will
    handle PICT format. Does that satisfy you ?


    Simon Slavin Guest

  8. #8

    Default Re: copying/pasting images in MacOS X

    <slavinshearsay.demon.co.uk> wrote:
    > Pretty much any application which copies or pastes images will
    > handle PICT format. Does that satisfy you ?
    This conversation has gone beyond what I had intended.
    Yes, I realize there are different image formats which have different
    capabilities.

    However, on MacOS 9 (and earlier), PICT was the format used to
    copy/paste any image which could be represented in the PICT format. This
    covered 99% of the cases.

    I think I can safely assume that Carbon applications will still put PICT
    images into the scrap.

    My question was that do Cocoa applications normally put PICT data into
    the scrap when copying images (if the image can be represented as a
    PICT)?

    Since PDF is the "native" image format for MacOS X, I was thinking that
    Cocoa applications would put PDF data into the scrap instead of PICT's,
    which would cause unexpected incompatibilities between Carbon and Cocoa
    applications.

    --
    [email]gbeggsCanada.com[/email] [url]http://www3.mb.sympatico.ca/~gbeggs1/[/url]
    Gerry Guest

Similar Threads

  1. XML, Copying Tagged Doc and Pasting in New Doc - Changes Structure
    By Dorothy_Corder@adobeforums.com in forum Adobe Indesign Windows
    Replies: 3
    Last Post: August 14th, 07:15 AM
  2. Form fields rotate after copying/pasting
    By Angelique_Higgins@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 12
    Last Post: November 3rd, 04:58 PM
  3. Help! Experimenting copying and pasting elements from IND into AI
    By Gill_Keeley@adobeforums.com in forum Adobe Indesign Macintosh
    Replies: 4
    Last Post: July 21st, 09:19 AM
  4. Error when copying and pasting
    By canadianflower in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: March 18th, 08:50 PM
  5. basic question/problem of copying and pasting all items of A5 on A4
    By Mozartsbum@adobeforums.com in forum Adobe Indesign Windows
    Replies: 4
    Last Post: April 15th, 12:16 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139