Picture DATA and how to show it

View: New views
9 Messages — Rating Filter:   Alert me  

Picture DATA and how to show it

by Thomas McGrath III-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Dear friends,

I have some data returned from an applescript that looks like this:

«data  
PICTED340000000001F001F4001102FF0C00FFFE000000480000004800000000000001F001F40000000000
  (continues on awhile) 963747572652E000000FF»

I of course deleted the «data PICT and » when playing around in RR.

It is a png file I think but I would like to display this picture in  
REV if possible. I have been reading through Applescript trying to  
find a way to convert this to an image of this data with no luck. I  
have also been reading the RR Dictionary and can't seem to figure this  
one out.


Anyone with experience with this? I thought I remembered someone  
talking about storing this type of data in a custom prop???


Any reply is appreciated.

Tom McGrath_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Picture DATA and how to show it

by Mark Schonewille-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tom,

I'd say this is a PICT file in hex form. I don't know whether you  
should convert it to binary first, but you could always try to write  
it to a file on disk and then import it, either as PICT or, if that  
doesn't work, as PNG.

Best regards,

Mark Schonewille

--

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Our servers may be off-line between 28 April and 1 May. If you have an  
urgent request, you can contact us at <economy.x.talk@...>.  
Apologies for any inconveniences.





On 28 apr 2008, at 22:16, Thomas McGrath III wrote:

> Dear friends,
>
> I have some data returned from an applescript that looks like this:
>
> «data  
> PICTED340000000001F001F4001102FF0C00FFFE000000480000004800000000000001F001F40000000000
>  (continues on awhile) 963747572652E000000FF»
>
> I of course deleted the «data PICT and » when playing around in RR.
>
> It is a png file I think but I would like to display this picture in  
> REV if possible. I have been reading through Applescript trying to  
> find a way to convert this to an image of this data with no luck. I  
> have also been reading the RR Dictionary and can't seem to figure  
> this one out.
>
>
> Anyone with experience with this? I thought I remembered someone  
> talking about storing this type of data in a custom prop???
>
>
> Any reply is appreciated.


_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Picture DATA and how to show it

by Thomas McGrath III-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mark,

The AS dict says "     data (picture) : data for this artwork, in the  
form of a picture     " but it does not refer to it's type or how it  
is stored i.e. Hex etc.

If I get the format for this in AS it states {«class PNG »} so even  
though it states PICT I think it is a PNG.

Export and import just hang up RR.

I have not used convert to binary before. What's the best way to  
handle that?

Thanks

Tom McGrath

On Apr 28, 2008, at 4:25 PM, Mark Schonewille wrote:

> Hi Tom,
>
> I'd say this is a PICT file in hex form. I don't know whether you  
> should convert it to binary first, but you could always try to write  
> it to a file on disk and then import it, either as PICT or, if that  
> doesn't work, as PNG.
>
> Best regards,
>
> Mark Schonewille
>
_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Picture DATA and how to show it

by Thomas McGrath III-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Mark et. al.

Also if I use Applescript to write the Data to a pict file I actually  
get this:

Ì4Ùˇ ˇ˛HHÙÄÄÄ







ÙÇ



Ït







@@ÙVpng  












appl



ÙHHÎ⁄PNGˇˇâPNG


IHDRÙfl%
ÀgAMAŸB÷O° pHYs  öú$tEXtSoftwareQuickTime  
6.5.2 (Mac OS X)ˆÈîtIME‘ )8æê◊+  
IDATxú¨[YsGrÆ≥èπ 08Hê!R+‰µ¥~pXy
°ÿµ7¸‡‘ã˝‡á◊~\;h)^[±á˜π$≈ à¡13=”gU93
´Ç/õ±%≤1hˆTef}ô˘eVãˇÁΩ{ˇ˙„wZÌdöƒQƒ/ãÇs!
§`å9∆ŒØå„EI^y†{BqV(•∫™öÕffl)≤ÕÕÕè+a™Jœ
etc.

which looks like binary data and states it IS a png file after all.

But I can't import this file to RR and have a picture come out. How do  
you  recommend converting this from binary to an image?

Ideas???

Thanks

Tom McGrath

On Apr 28, 2008, at 4:46 PM, Thomas McGrath III wrote:

> Mark,
>
> The AS dict says "     data (picture) : data for this artwork, in  
> the form of a picture     " but it does not refer to it's type or  
> how it is stored i.e. Hex etc.
>
> If I get the format for this in AS it states {«class PNG »} so even  
> though it states PICT I think it is a PNG.
>
> Export and import just hang up RR.
>
> I have not used convert to binary before. What's the best way to  
> handle that?
>
> Thanks
>
> Tom McGrath
>
> On Apr 28, 2008, at 4:25 PM, Mark Schonewille wrote:
>
>> Hi Tom,
>>
>> I'd say this is a PICT file in hex form. I don't know whether you  
>> should convert it to binary first, but you could always try to  
>> write it to a file on disk and then import it, either as PICT or,  
>> if that doesn't work, as PNG.
>>
>> Best regards,
>>
>> Mark Schonewille
>>
> _______________________________________________
> use-revolution mailing list
> use-revolution@...
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Picture DATA and how to show it

by Chipp Walters-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Just a suggestion...

Is there anyway to use Applescript to copy the data to the clipboard? Then
perhaps the clipbaord[image] could be used to access it.
_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Picture DATA and how to show it

by Thomas McGrath III-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I really need some help on this one!!!

So far I can get the artwork and read the result in AS, then again in  
applescript I can write the hex to a file where it is now binary and  
read that file in RR. It works but this is a sloppy solution as it is  
Mac only for one and Applescript is doing all the work where I would  
like RR to handle the encoding etc. Then I can make this a cross  
platform solution.

Here is my applescript:
try
        tell application "iTunes"
                set my_Artwork to the (data of artwork 1 of track "One" of playlist  
"U2") as picture
               
        end tell

        -- This sets the path to the pictures folder of iTunes
        set file_path to (path to "pdoc" as string)
        set file_name to (the file_path & "MyArtwork" & ".pict") as string
        do shell script "cd " & (POSIX path of file_path) & " ;ls | grep \""  
& "MyArtwork" & ".pict\" ; " & "echo '.'"
        set shell_result to the result as string
       
        open for access file_name write permission 1
        copy the result to file_reference

         -- Here is where I can write to the file as a picture, this  
turns the data into binary
        write myTrack starting at 0 to file_reference as picture
        close access file_reference

         -- here I return the file_name for Revolution to then set the  
filename of image "Artwork" to the returned result
        return file_name
end try

The problem with this is that I have to write to the users pictures  
folder for one and that each time I access the script I am writing  
over the previous file. I would like to just encode this and not write  
to a file at all if possible.

What i would really like to do is either have RR open a file and write  
to it the my_Artwork as a picture (thereby setting it to binary) or  
better yet just have RR write to a custom Prop and encode that as  
binary and set an image to that when done.

The new applescript would then look like this:
try
      tell application "iTunes"
           set my_artwork to the (data of artwork 1 of track "One" of  
playlist "U2) as picture
           return my_artwork
     end tell
end try

I have done this and tried to encode the result in RR with no success.  
I have tried every version of binaryEncode with no results and a lot  
of force quits.

Does anyone here have some ideas on where to go from here?????

Thanks

Tom McGrath

On Apr 28, 2008, at 6:09 PM, Thomas McGrath III wrote:

> Mark et. al.
>
> Also if I use Applescript to write the Data to a pict file I  
> actually get this:
> which looks like binary data and states it IS a png file after all.
>
> But I can't import this file to RR and have a picture come out. How  
> do you  recommend converting this from binary to an image?
>
> Ideas???
>
> Thanks
>
> Tom McGrath

_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Parent Message unknown Re: Picture DATA and how to show it

by Richard Gaskin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thomas McGrath III wrote:
> Does anyone here have some ideas on where to go from here?????

Apple's APIs generally favor C++ for such data structures.
Sounds like a good job for an external.

--
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com
_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Picture DATA and how to show it

by Mark Schonewille-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Tom,

> copy the result to file_reference

should be:

copy shell_result to file_reference

It is really confusing that you use .pict as the file extension.

Assuming that you are writing a valid PNG file to disk, you can also  
return this to Revolution instead of the file name:

return shell_result -- applescript

-- revolution:
set rslt to the result
if not (rslt contains "error") then
   set the text of img "Your Image" to rslt
end if

If all this doesn't work, you might try to write the data to a file  
anyway and set the filename of a player to the path to that file,  
because it looks like QT knows how to handle the data.

Best regards,

Mark Schonewille

--

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Our servers may be off-line between 28 April and 1 May. If you have an  
urgent request, you can contact us at <economy.x.talk@...>.  
Apologies for any inconveniences.





On 29 apr 2008, at 06:13, Thomas McGrath III wrote:

> I really need some help on this one!!!
>
> So far I can get the artwork and read the result in AS, then again  
> in applescript I can write the hex to a file where it is now binary  
> and read that file in RR. It works but this is a sloppy solution as  
> it is Mac only for one and Applescript is doing all the work where I  
> would like RR to handle the encoding etc. Then I can make this a  
> cross platform solution.
>
> Here is my applescript:
> try
> tell application "iTunes"
> set my_Artwork to the (data of artwork 1 of track "One" of  
> playlist "U2") as picture
>
> end tell
>
> -- This sets the path to the pictures folder of iTunes
> set file_path to (path to "pdoc" as string)
> set file_name to (the file_path & "MyArtwork" & ".pict") as string
> do shell script "cd " & (POSIX path of file_path) & " ;ls | grep  
> \"" & "MyArtwork" & ".pict\" ; " & "echo '.'"
> set shell_result to the result as string
>
> open for access file_name write permission 1
> copy the result to file_reference
>
>        -- Here is where I can write to the file as a picture, this  
> turns the data into binary
> write myTrack starting at 0 to file_reference as picture
> close access file_reference
>
>        -- here I return the file_name for Revolution to then set the  
> filename of image "Artwork" to the returned result
> return file_name
> end try
>
> The problem with this is that I have to write to the users pictures  
> folder for one and that each time I access the script I am writing  
> over the previous file. I would like to just encode this and not  
> write to a file at all if possible.
>
> What i would really like to do is either have RR open a file and  
> write to it the my_Artwork as a picture (thereby setting it to  
> binary) or better yet just have RR write to a custom Prop and encode  
> that as binary and set an image to that when done.
>
> The new applescript would then look like this:
> try
>     tell application "iTunes"
>          set my_artwork to the (data of artwork 1 of track "One" of  
> playlist "U2) as picture
>          return my_artwork
>    end tell
> end try
>
> I have done this and tried to encode the result in RR with no  
> success. I have tried every version of binaryEncode with no results  
> and a lot of force quits.
>
> Does anyone here have some ideas on where to go from here?????
>
> Thanks
>
> Tom McGrath
>
> On Apr 28, 2008, at 6:09 PM, Thomas McGrath III wrote:
>
>> Mark et. al.
>>
>> Also if I use Applescript to write the Data to a pict file I  
>> actually get this:
>> which looks like binary data and states it IS a png file after all.
>>
>> But I can't import this file to RR and have a picture come out. How  
>> do you  recommend converting this from binary to an image?
>>
>> Ideas???
>>
>> Thanks
>>
>> Tom McGrath
>
> _______________________________________________
> use-revolution mailing list
> use-revolution@...
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Picture DATA and how to show it

by Thomas McGrath III-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chipp,

Yes, this is finally what I decided upon and it works rather smoothly  
for this usage.

Thanks

Tom McGrath

On Apr 28, 2008, at 6:16 PM, Chipp Walters wrote:

> Just a suggestion...
>
> Is there anyway to use Applescript to copy the data to the  
> clipboard? Then
> perhaps the clipbaord[image] could be used to access it.
> _______________________________________________
> use-revolution mailing list
> use-revolution@...
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution