Saving JPGs?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Saving JPGs?

Dan Antion
I have an object that is composed of some information and an image.  The
image is initially read in from a JPG, to an OLEPicture.  If I try to
save the image portion, using OLEPicture saveAsFile, I get a bitmap
file, not a JPG.  Am I doing something wrong?  Is there a way to save an
image as a JPG?

-Dan
Dan Antion


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Steve Alan Waring
Dan Antion wrote:
> I have an object that is composed of some information and an image.
> The image is initially read in from a JPG, to an OLEPicture.  If I
> try to save the image portion, using OLEPicture saveAsFile, I get a
> bitmap file, not a JPG.  Am I doing something wrong?  Is there a way
> to save an image as a JPG?

Hi Dan,

AFAIK there is no way to save an image as a JPG using the win32 api. If
there is, I would also like to know about it.

Louis Sumberg and I are in the middle of working on a wrapping an old
version of the IntelJpegLibrary. There is still plenty of work to do, but it
is saving out Images in jpeg format.

If you dont mind experimenting, email me, and I will send it through.

Thanks,
Steve

--
Steve Waring
Email: [hidden email]
About: http://www.dolphinharbor.org/dh/harbor/steve.html
Journal: http://www.stevewaring.net/blog/home/index.html


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Blair McGlashan
In reply to this post by Dan Antion
"Dan Antion" <[hidden email]> wrote in message
news:[hidden email]...
> I have an object that is composed of some information and an image.  The
> image is initially read in from a JPG, to an OLEPicture.  If I try to
> save the image portion, using OLEPicture saveAsFile, I get a bitmap
> file, not a JPG.  Am I doing something wrong?  Is there a way to save an
> image as a JPG?

I don't think OLEPicture has that capability - it can display other formats
than BMP, but not save them. We do have a nascent GDI+ package that has this
kind of capability (i.e. it can save JPGs and PNGs . It is pretty basic at
present, but I can send it to you if you like.

Actually I think the GDI+ package might make a good community project
(there's a lot of cool stuff in it), so I'd be willing to donate what we
have at present if anyone is interested in working on it.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Dan Antion
I would appreciate taking a look at what you have for GDI+.  I'd be
willing to work on this, but I should warn you that I am fairly new to
Dolphin.

Thanks
Dan

Blair McGlashan wrote:

> "Dan Antion" <[hidden email]> wrote in message
> news:[hidden email]...
>
>>I have an object that is composed of some information and an image.  The
>>image is initially read in from a JPG, to an OLEPicture.  If I try to
>>save the image portion, using OLEPicture saveAsFile, I get a bitmap
>>file, not a JPG.  Am I doing something wrong?  Is there a way to save an
>>image as a JPG?
>
>
> I don't think OLEPicture has that capability - it can display other formats
> than BMP, but not save them. We do have a nascent GDI+ package that has this
> kind of capability (i.e. it can save JPGs and PNGs . It is pretty basic at
> present, but I can send it to you if you like.
>
> Actually I think the GDI+ package might make a good community project
> (there's a lot of cool stuff in it), so I'd be willing to donate what we
> have at present if anyone is interested in working on it.
>
> Regards
>
> Blair
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Bill Schwab
In reply to this post by Blair McGlashan
Blair,

> Actually I think the GDI+ package might make a good community project
> (there's a lot of cool stuff in it), so I'd be willing to donate what we
> have at present if anyone is interested in working on it.

How are you connecting to it?  I thought I read that GDI+ was exposed as C++
classes, which struck me as a **really** bad idea. COM interfaces would be
language neutral and since it's probably all in a DLL anyway, they would be
in-proc and therefore quite fast.  It works for DirectX and lots of other
things, as you well know.

Am I missing something?

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Blair McGlashan
"Bill Schwab" <[hidden email]> wrote in message
news:av7hvj$o84$[hidden email]...
> Blair,
>
> > Actually I think the GDI+ package might make a good community project
> > (there's a lot of cool stuff in it), so I'd be willing to donate what we
> > have at present if anyone is interested in working on it.
>
> How are you connecting to it?  I thought I read that GDI+ was exposed as
C++
> classes, which struck me as a **really** bad idea. COM interfaces would be
> language neutral and since it's probably all in a DLL anyway, they would
be
> in-proc and therefore quite fast.  It works for DirectX and lots of other
> things, as you well know.
>
> Am I missing something?

Yes, C++ is just one possible language binding for GDI+. It's also
accessible from .Net lingos. The raw interface is exposed as a set of
standard function calls, with an object pointer as the first parameter, and
that can be treated as an opaque handle in language bindings. This isn't
immediately obvious, because the documentation doesn't make a big thing of
it, but the raw interface is actually documented in a basic way:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/gdi+
/gdi+reference/flatapi.asp

I'll send out the package to those who are interested once I have tried
loading it into D5.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Blair McGlashan
In reply to this post by Dan Antion
"Dan Antion" <[hidden email]> wrote in message
news:[hidden email]...
> I would appreciate taking a look at what you have for GDI+.  I'd be
> willing to work on this, but I should warn you that I am fairly new to
> Dolphin.

For those that are interested the package can be found at:

http://www.object-arts.com/Lib/Downloads/5.0/Gdiplus.zip

It has a complete wrapping of the basic GDI+ API, but little in the way of
higher level support.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Louis Sumberg-2
Blair,

> http://www.object-arts.com/Lib/Downloads/5.0/Gdiplus.zip
> ... has a complete wrapping of the basic GDI+ API, ...

Thanks so much for putting this together and making it available.  I've
looked at this a little (dipped my toe in the pond) and so far it's working
well for me - I might be able to retire an activex control and a shareware
program that I've been using for simple imaging (thumbnails and lossless
jpeg rotation).

I'm using Win98 and so had to download the gdiplus.dll redistributable from
MSDN, put it in Windows\System and all works fine.  I have run into one
problem though - if I save my image and restart it, then I get an "Out of
memory" walkback (see end of this post) when I try to display an image.  If
I then uninstall the package and reinstall it, it works again (till I save
and restart the image again).  I don't think it's anything I've done in the
image because I get this even if I've done a panic before image save.  I
hope this isn't a Win98 limitation - that'd be a bummer :(

For others interested in taking a look, below is a method I added for
generating a thumbnail from an image and also some workspace code for a "99
cent thumbnail viewer".
"Filein this method"
!GdiplusImage methodsFor!

thumbnailWithExtent: aPoint
 | gpImage |
 gpImage := ExternalHandle new.
 status := GdiplusLibrary default
    GdipGetImageThumbnail: self asParameter
    thumbWidth: aPoint x
    thumbHeight: aPoint y
    thumbImage: gpImage
    pfnCallback: nil
    callbackData: nil.
 status = Ok
  ifFalse: [^GdiplusError signal: 'Error in GdipGetImageThumbnail' with:
status].
 ^self class fromOwnedHandle: gpImage! !
!GdiplusImage categoriesFor: #thumbnailWithExtent:!operations!public! !

"Evaluate this from a workspace"
"Setup scrolling shellview."
sv := Shell show view layoutManager: GridLayout new.
sdv := sv addSubView: ScrollingDecorator new.
mv := sdv addSubView: ContainerView new.
mv usePreferredExtent: true.
mv layoutManager: (FlowLayout new horizontalGap: 5; verticalGap: 5).
onPositionChangedBlock := [mv extent: sv clientExtent - 20].
sv presenter when: #positionChanged: send: #value to:
onPositionChangedBlock.

"Display a bunch of thumbnails."
directory := BrowseFolderDialog new value: 'c:\my documents'; showModal.
actionPerformedBlock := [:e |
 (ImagePresenter show: 'Basic image' on: (GdiplusImage fromFile: e)) view
topView showMaximized; caption: e].
height := 120.
File forAll: '*.jpg' in: directory do: [:e |
 (e path indexOfSubCollection: '_vti_') = 0 ifTrue: [
  img := GdiplusImage fromFile: e path.
  width := img extent x / img extent y * height.
  thumbImage := img thumbnailWithExtent: width rounded @ height.
  view := mv addSubView: (ImageView new model: thumbImage asValue).
  view viewMode: #scaleToFit; extent: height @ height.
  view presenter when: #actionPerformed send: #value: to:
actionPerformedBlock with: e path.
  SessionManager inputState pumpMessages]].

Notes: File>>forAll: will look in all subdirectories of the chosen directory
so the number of jpegs can get pretty big.  I used #forAll: rather than
#for: to do some stress testing, and it had no problem with over a thousand
thumbnails.  The line that tests for '_vti_' is only in there because I have
directories with '.jpg' files that have been generated by Word, which
apparently aren't real jpeg files.  Double-click on a thumbnail and a
fullscreen window will pop up showing the image and its filename in the
caption.  I put the SessionManager line in as sort of a progress indicator,
though there's probably a better way to update the display as each thumbnail
is generated.  One thing I just noticed and will look at a little closer -
there must be some sort of caching that Windows does, because I just tried
viewing a directory over a network and it was pretty slow, but when I tried
it again, it was a lot faster.

Still having fun *s*.  Comments, questions, and better ways to do things are
always welcome.

-- Louis

5:19:49 PM, 1/11/03: 'Error loading image ''C:\My Documents\Dolphin
Smalltalk 5.0\test.jpg'': Out of memory'
GdiplusImage>>loadFromFile:extent:
GdiplusImage(Image)>>createHandle
GdiplusImage(GraphicsTool)>>basicRealize
GdiplusImage(GraphicsTool)>>realize
GdiplusImage(GraphicsTool)>>handle
ImageView>>onPaintRequired:
[] in ImageView(View)>>basicPaint:wParam:lParam:


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Dan Antion
Louis Sumberg wrote:

> Blair,
>
>
>>http://www.object-arts.com/Lib/Downloads/5.0/Gdiplus.zip
>>... has a complete wrapping of the basic GDI+ API, ...
>
>
> Thanks so much for putting this together and making it available.  I've
> looked at this a little (dipped my toe in the pond) and so far it's working
> well for me - I might be able to retire an activex control and a shareware
> program that I've been using for simple imaging (thumbnails and lossless
> jpeg rotation).
>
> I'm using Win98 and so had to download the gdiplus.dll redistributable from
> MSDN, put it in Windows\System and all works fine.  I have run into one
> problem though - if I save my image and restart it, then I get an "Out of
> memory" walkback (see end of this post) when I try to display an image.  If
> I then uninstall the package and reinstall it, it works again (till I save
> and restart the image again).  I don't think it's anything I've done in the
> image because I get this even if I've done a panic before image save.  I
> hope this isn't a Win98 limitation - that'd be a bummer :(
>
> For others interested in taking a look, below is a method I added for
> generating a thumbnail from an image and also some workspace code for a "99
> cent thumbnail viewer".

Louis,

I have not had any problems after loading the GdiPlus package.  I am
running Dolphin XP 5 under Windows XP Pro.  Just to make sure, I filed
in your method and ran that too, still no problems.

I don't know if you've gotten this far, but do you have any problems
with a packaged app on Windows 98?  Sorry to be taking advantage of your
problem, but I don't have a 98 system to test on.  I wanted to use this
as opposed to plgblt() for jpg rotation, since plgblt() doesn't work
before NT3.

-Dan

>
> -- Louis
>
> 5:19:49 PM, 1/11/03: 'Error loading image ''C:\My Documents\Dolphin
> Smalltalk 5.0\test.jpg'': Out of memory'
> GdiplusImage>>loadFromFile:extent:
> GdiplusImage(Image)>>createHandle
> GdiplusImage(GraphicsTool)>>basicRealize
> GdiplusImage(GraphicsTool)>>realize
> GdiplusImage(GraphicsTool)>>handle
> ImageView>>onPaintRequired:
> [] in ImageView(View)>>basicPaint:wParam:lParam:
>
>


Reply | Threaded
Open this post in threaded view
|

Update to previous post

Dan Antion
In reply to this post by Louis Sumberg-2
Louis Sumberg wrote:
> Blair,
>
>
>>http://www.object-arts.com/Lib/Downloads/5.0/Gdiplus.zip
>>... has a complete wrapping of the basic GDI+ API, ...
>
>

Snipped

I played around with this for a while, and I was able to recreate a
"similar" error.  It occurs at the same place, but on my XP machie, it
comes up as "Invalid access to memory location".  As you experienced,
removing zombies, exiting image do not help.

I did find a reliable way to clean this up.  What is shown below is
probably a certain amount of overkill.  It represents the various
attempts I made.  I tried removing a few of (what I assumed to be
redundant) methods, and it did not work.  I don't have any more time to
play with this today, so I'll put this here in case it helps.  If I
execute these before exiting Dolphin (and in my case saving image), I
can access the GdiPlus library upon restart without errors.  I hope this
helps

--Dan

GdiplusImage allInstances do:[:each |
        each dependents do:[:d | each removeDependent: d].
        each basicFree.
        each release.
        each oneWayBecome: nil ].

GdiplusLibrary allInstances do:[:each |each  close;
        oneWayBecome: nil]



>
> 5:19:49 PM, 1/11/03: 'Error loading image ''C:\My Documents\Dolphin
> Smalltalk 5.0\test.jpg'': Out of memory'
> GdiplusImage>>loadFromFile:extent:
> GdiplusImage(Image)>>createHandle
> GdiplusImage(GraphicsTool)>>basicRealize
> GdiplusImage(GraphicsTool)>>realize
> GdiplusImage(GraphicsTool)>>handle
> ImageView>>onPaintRequired:
> [] in ImageView(View)>>basicPaint:wParam:lParam:
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Dan Antion
In reply to this post by Dan Antion
I played around with this for a while, and I was able to recreate a
"similar" error.  It occurs at the same place, but on my XP machie, it
comes up as "Invalid access to memory location".  As you experienced,
removing zombies, exiting image do not help.

I did find a reliable way to clean this up.  What is shown below is
probably a certain amount of overkill.  It represents the various
attempts I made.  I tried removing a few of (what I assumed to be
redundant) methods, and it did not work.  I don't have any more time to
play with this today, so I'll put this here in case it helps.  If I
execute these before exiting Dolphin (and in my case saving image), I
can access the GdiPlus library upon restart without errors.  I hope this
helps

--Dan

GdiplusImage allInstances do:[:each |
     each dependents do:[:d | each removeDependent: d].
     each basicFree.
     each release.
     each oneWayBecome: nil ].

GdiplusLibrary allInstances do:[:each |each  close;
     oneWayBecome: nil]

Dan Antion wrote:

>
>
> Louis Sumberg wrote:
>
>> Blair,
>>
>>
>>> http://www.object-arts.com/Lib/Downloads/5.0/Gdiplus.zip
>>> ... has a complete wrapping of the basic GDI+ API, ...
>>
>>
>>
>> Thanks so much for putting this together and making it available.  I've
>> looked at this a little (dipped my toe in the pond) and so far it's
>> working
>> well for me - I might be able to retire an activex control and a
>> shareware
>> program that I've been using for simple imaging (thumbnails and lossless
>> jpeg rotation).
>>
>> I'm using Win98 and so had to download the gdiplus.dll redistributable
>> from
>> MSDN, put it in Windows\System and all works fine.  I have run into one
>> problem though - if I save my image and restart it, then I get an "Out of
>> memory" walkback (see end of this post) when I try to display an
>> image.  If
>> I then uninstall the package and reinstall it, it works again (till I
>> save
>> and restart the image again).  I don't think it's anything I've done
>> in the
>> image because I get this even if I've done a panic before image save.  I
>> hope this isn't a Win98 limitation - that'd be a bummer :(
>>
>> For others interested in taking a look, below is a method I added for
>> generating a thumbnail from an image and also some workspace code for
>> a "99
>> cent thumbnail viewer".
>
>
> Louis,
>
> I have not had any problems after loading the GdiPlus package.  I am
> running Dolphin XP 5 under Windows XP Pro.  Just to make sure, I filed
> in your method and ran that too, still no problems.
>
> I don't know if you've gotten this far, but do you have any problems
> with a packaged app on Windows 98?  Sorry to be taking advantage of your
> problem, but I don't have a 98 system to test on.  I wanted to use this
> as opposed to plgblt() for jpg rotation, since plgblt() doesn't work
> before NT3.
>
> -Dan
>
>>
>> -- Louis
>>
>> 5:19:49 PM, 1/11/03: 'Error loading image ''C:\My Documents\Dolphin
>> Smalltalk 5.0\test.jpg'': Out of memory'
>> GdiplusImage>>loadFromFile:extent:
>> GdiplusImage(Image)>>createHandle
>> GdiplusImage(GraphicsTool)>>basicRealize
>> GdiplusImage(GraphicsTool)>>realize
>> GdiplusImage(GraphicsTool)>>handle
>> ImageView>>onPaintRequired:
>> [] in ImageView(View)>>basicPaint:wParam:lParam:
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Chris Uppal-3
In reply to this post by Louis Sumberg-2
Louis Sumberg wrote:

> I have run into one problem though - if I save my image and
> restart it, then I get an "Out of memory" walkback (see end of this
> post) when I try to display an image.  If I then uninstall the
> package and reinstall it, it works again (till I save and restart the
> image again).

Like Dan Alton, I find that something similar happens on Win2K.

It's something to do with the GdiplusLibrary not getting reset properly.  I'm
not really sure what the correct fix is, but adding a new method to
GdiplusLibrary as below seems to fix that problem on my machine:

================
!GdiplusLibrary class methodsFor!

clear
#CUadded.  "hasty nack"
 self closeDefault.
 self clearMethodDictionary: self methodDictionary.! !
!GdiplusLibrary class categoriesFor: #clear!initializing!private! !
================

That fixes one problem, however I've also found that leaving a thumbnail view
(as per your example) open while saving the image, will cause walkbacks on
restart (or maybe crashes with W98, who knows?).  I think that's because when
you create the thumbnail, there's no reference stored to the 'fileLocator' (or
should it be 'identifier'?) instvar of the new GdiplusImage.  So Dolphin
doesn't know how to recreate it on restart, but needs to do so in order to do
the layout of the containing View.  I've no idea what the proper fix should be
for this, possible a new subclass -- ThumbnailImage --  that subclasses
GdiplusImage, remembers which file it was derived from but also holds a fixed
extent ?

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Chris Uppal-3
I wrote:

> Like Dan Alton, I find [...].

Should have been Dan Antion.  Sorry, Dan.

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Dan Antion
No harm.  Given that the 'I' is silent, our last name is either spelled
or pronounced incorrectly most of the time ;)

-Dan

Chris Uppal wrote:

> I wrote:
>
>
>>Like Dan Alton, I find [...].
>
>
> Should have been Dan Antion.  Sorry, Dan.
>
>     -- chris
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Louis Sumberg-2
In reply to this post by Chris Uppal-3
Chris and Dan,

Thanks for your responses.  Chris, your "hasty nack" works great!

> ... leaving a thumbnail view open while saving the image, will cause
walkbacks on restart ...

Indeed it does - I guess I was lucky and hadn't run into this.  A quick fix
is to add
    pathString ifNil: [^nil].
as the first line in GdiplusImage>>basicLoadFromFile:

This will suppress the walkbacks, though the images will not be restored
because, as you pointed out, the info just ain't there.  I do notice that
the extent info is there.  For example, if you run the viewer, save and
restart, the viewer comes up blank.  Leave the viewer open and evaluate the
section of code to add more images and you'll see that the new images are
added after the (invisible) images in the viewer.

A ThumbnailImage subclass might be a good solution, remembering the file,
but for me, the quick fix might be good enough for now - i.e., it's a
problem in the image, not in a deployed application.  (Off the top of my
head rambling - it might work to copy the fileLocator and identifier into
the thumbnail instance when it's created, something that doesn't happen
right now.  Since the extent info is there, the ThumbImage class should have
all the info it needs to realize the image upon restart.)

I did start on converting the workspace code to an app - it works fine,
i.e., no crashes when deployed.  One hellacious problem I've run into is to
get ScrollingDecorator to work properly.  I remember Ian saying that the key
with ScrollingDecorator is to tweak things until it works, but my tweaking
isn't doing it.  Attached is a package (99 cents downgraded to a nickle) if
anyone wants to take a stab at it.

Finally, FWIW, here are a couple of methods to rotate an image:

!GdiplusImage methodsFor!

basicRotate: anInteger
 GdiplusLibrary default GdipImageRotateFlip: self asParameter rfType:
anInteger! !
!GdiplusImage categoriesFor: #basicRotate:!operations!private! !

!GdiplusImage methodsFor!

rotate90
 self basicRotate: 1! !
!GdiplusImage categoriesFor: #rotate90!operations!public! !

-- Louis





begin 666 LAS NickleViewer.pac
M?"!P86-K86=E('P-"G!A8VMA9V4@.CT@4&%C:V%G92!N86UE.B G3$%3($YI
M8VML959I97=E<B<N#0IP86-K86=E('!A>%9E<G-I;VXZ(# [#0H)8F%S:6-#
M;VUM96YT.B G)RX-"@T*<&%C:V%G92!B87-I8U!A8VMA9V5697)S:6]N.B G
M,"XP,#DG+@T*#0IP86-K86=E(&EM86=E4W1R:7!P97)">71E<SH@*$)Y=&5!
M<G)A>2!F<F]M2&5X4W1R:6YG.B G,C$U,S4T-#(R,#,Q,C T-C!&,$0P,# T
M,# P,# P-#DV1#8Q-C<V-34S-S0W,C8Y-S W,#8U-S(P,# P,# P,# P,# P
M,# P-3(P,# P,# P.# P,# P,#1#-#$U,S(P-#<T-#0Y,D(U,C P,# P,#(S
M,# P,# P-$,V1C<U-CDW,S(P-3,W-39$-C(V-3<R-C<U0S4P-CDV,S4P-S(V
M.39%-S0U0S1#-#$U,S(P-#<T-#0Y,D(R138U-S@V-3E!,# P,# P,# P,# P
M,#!",# Q,# P,#4R,# P,# P,48P,# P,# T0S8Q-S,T-S0T-#DU,#9#-S4W
M,S4R-S4V13<T-CDV1#8U-3,V-3<S-S,V.39&-D4T1#8Q-D4V,38W-C4W,D5&
M0D8R-3 P,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P
M,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P,# G*2X-
M"@T*<&%C:V%G92!C;&%S<TYA;65S#0H)861D.B C3&%S3FEC:VQE5FEE=V5R
M.PT*"6%D9#H@(TQA<TYI8VML959I97=E<E)U;G1I;65397-S:6]N36%N86=E
M<CL-"@EY;W5R<V5L9BX-"@T*<&%C:V%G92!B:6YA<GE';&]B86Q.86UE<SH@
M*%-E="!N97<-"@EY;W5R<V5L9BDN#0H-"G!A8VMA9V4@9VQO8F%L06QI87-E
M<SH@*%-E="!N97<-"@EY;W5R<V5L9BDN#0H-"G!A8VMA9V4@86QL4F5S;W5R
M8V5.86UE<SH@*%-E="!N97<-"@EA9&0Z("-,87-.:6-K;&56:65W97(@+3X@
M)T1E9F%U;'0@=FEE=R<[#0H)>6]U<G-E;&8I+@T*#0IP86-K86=E('-E=%!R
M97)E<75I<VET97,Z("A)9&5N=&ET>5-E="!N97<-"@EA9&0Z("<N+EPN+EQ/
M8FIE8W0@07)T<UQ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1C<U-S0P,# P,# P,# S,# P,# P,#$P,# P,# P,3 P,# P
M,# Q,# P,# P14$P,# P,# P,# P,# P,# P,#$P,# P-C(P,# P,# P,# P
M,# P,# P,# P,# P-#8P-3 W,# P,C P,# P,#1$-C4V13<U-#(V,3<R,# P
M,# P,# P,# P,# P,#$P,# P,# P-C(P,# P,# P,3 P,# P,#0V,#4P-# P
M,#(P,# P,# T1#8U-D4W-3 P,# P,# P,# P,# P,# Q,# P,# P,#8R,# P
M,# P,#,P,# P,# T-C R,$8P,# Q,# P,# P-#,V1C9$-D0V,39%-C0T1#8U
M-D4W-30Y-S0V-39$,# P,# P,# P,3 P,# P,#0V,#4Q,C P,#0P,# P,# T
M,S9&-D0V1#8Q-D4V-#0T-C4W,S8S-S(V.3<P-S0V.39&-D4P,# P,# P,$)!
M,# P,# P,# P,# P,# U,C P,# P,#$Q,# P,# P-C$V-#8T-#0V.3<R-C4V
M,S<T-D8W,C<Y-#8V.39#-C4W,S4R,# P,# P,#<P,# P,# R-C0Q-C0V-#)%
M,D4R13 Q,# P,# P,#$P,# P,# P,# P,# P,$$R,#(P,# P,# P,# P,# P
M,3 P,# P,$,R,#(P,# P,# P,# P,#!"03 P,# P,# P,# P,# P-3(P,# P
M,# P-3 P,# P,#8S-D,V-38Q-S(U,C P,# P,# V,# P,# P,C8T,S9#-C4V
M,3<R,#$P,# P,# P,3 P,# P,# P,# P,# P03(P,C P,# P,# P,# P,# Q
M,# P,# P0S(P,C P,# P,# P,# P,$)!,# P,# P,# P,# P,# U,C P,# P
M,# T,# P,# P-C4W.#8Y-S0U,C P,# P,# U,# P,# P-#4R-C<X-CDW-# Q
M,# P,# P,#$P,# P,# P,# P,# P,#4R,# P,# P,#4P,# P,# R-C0V-CDV
M0S8U,# P,# P,# U,C P,# P,# P,# P,# P,# P,# P,# P,# P,# P,# P
M,# P,# P,# P,# P,# P,3 P,# P,# P,# P,# P,# P,# P,# P,# P,# P
M,# P,# P,# P,#$P,# P,# P,# P,# P,# P,# P,# P,#8P,3!&,# T1#8U
M-S,W,S8Q-C<V-34S-C4W,3<U-C4V138S-C4P,# P,# P,$-!,# P,# P,# P
M,# P,#!$,# P,# P,#8R,# P,# P,#(P,# P,# P-C S,$(P,#1$-C4W,S<S
M-C$V-S8U-3,V-39%-C0P,# P,# P,$)!,# P,# P,# P,# P,# U,C P,# P
M,#$P,# P,# P-C,W,C8U-C$W-#8U-#$W-#-!-C4W.#<T-C4V13<T,T$V,C P
M,# P,# R,# P,# P,#8P,C U,# U,#9&-CDV13<T,# P,# P,# P0C P,# P
M,#!",# P,# P-C(P-# P,# P,# P,# P,$$U,#0P,# P0S<P,3 P,#!!,# Q
M,# P,#$R,#0P,# P,# P,# P,#!"03 P,# P,# P,# P,# P-3(P,# P,# P
M.# P,# P,#9$-C4V13<U-#(V,3<R,T$V,C P,# P,# Q,# P,# P-3 P,C P
M,#!!,# Q,# P,# V,#$P1C P-3<T.31%-#0T1C4W-3 T0S0Q-#,T-31$-#4T
M134T,# P,# P,# W,C P,# P,#)#,# P,# P,D,P,# P,# P,# P,# P,# P
M,# P,# P1D9&1D9&1D9&1D9&1D9&1D9&1D9&1D9&1D9&1D9&1D8P-3 P,# P
M,# U,# P,# P-3<P,C P,#!%.# P,# P,$-!,# P,# P,# P,# P,#!$,# P
M,# P,#8R,# P,# P,#$P,# P,# Y03 Q,# P,# P,# P,# P.4$P,# P,# P
M,# P,# P,$,P,#$P,# P-3(P,# P,# Q,C P,# P,#4S-C,W,C9&-D,V0S8Y
M-D4V-S0T-C4V,S9&-S(V,3<T-D8W,C8R,# P,# P,3(P,# P,# P,# P,# P
M,$$P,#$P,# P-C(P,# P,# P,C P,# P,#@R,# P,# P,#0P,# P,# P,# P
M,S T-# Q,# P,C P,C P-3 P,# P,# P,# P,# P,# P,# P,# P,# P,# P
M-S P,# P,# P,# P,# P,# P,# P,# P,# P,# P,#(P,#4P,# P,#8P,#$X
M,# U,S8S-S(V1C9#-D,V.39%-C<T-#8U-C,V1C<R-C$W-#9&-S(T0S8Q-SDV
M1C<U-S0P,# P,# P,$5!,# P,# P,# P,# P,# P,# Q,# P,#8R,# P,# P
M,#(P,# P,# Y03 Q,# P,# P,# P,# P.4$P,# P,# P,# P,# P,$,P,#$P
M,# P-3(P,# P,# P1# P,# P,#0S-D8V13<T-C$V.39%-C4W,C4V-CDV-3<W
M-C(P,# P,# P1C P,# P,# P,# P,# P,C P-3 P,# V,C P,# P,# R,# P
M,# P.#(P,# P,# P-# P,# P,# P,# P,#0T,#$P,# R,#!#,# U,# P,# P
M,# P,# P,# P,# P,# P,# P,# P,# W,# P,# P,# P,# P,# P,# P,# P
M,# P,# P,# P0S P-3 P,# P-C S,$$P,#0V-D,V1C<W-$,V,3<Y-D8W-3<T
M,# P,# P,# P0C P,# P,#!",# P,# P0D$P,# P,# P,# P,# P,#4R,# P
M,# P,#0P,# P,# V0S8U-C8W-$5!,# P,# P,# P,# P,# P,# Q,# P,#,P
M,#(P,# P,# P,# P,#!$,C S,# P,# P,# P,# P0T$P,# P,# P,# P,# P
M,$0P,# P,# P-C(P,# P,# P,3 P,# P,#$R,#0P,# P,# P,# P,# S,# T
M,# P,#8R,# P,# P,#(P,# P,# V,C T,# P,# P,# P,# P,#$P,# P,# P
M,3 P,# P,#8R,#0P,# P,# P,# P,# Y-3 T,# P,$8U,#$P,# P0S P-3 P
M,#!$,C T,# P,# P,# P,# P-S(P,# P,# R0S P,# P,#)#,# P,# P,# P
M,# P,# P,3 P,# P,$9&1D9&1D9&1D9&1D9&1D9&1D9&1D9&1D9&1D9&1D9&
M,# P,# P,# P,# P,# P,#1!,#(P,# P1D$P,# P,#!#03 P,# P,# P,# P
M,# P1# P,# P,# S,# R,# P,#8R,#0P,# P,# P,# P,#!#,3 P,# P,$,Q
M,# P,# P,# P,# P,# Q,S P,# P,#4R,# P,# P,#(P,# P,# V1#<V,# P
M,# P,# V,C T,# P,# P,# P,# P,#$P,# P,# P,3 P,# P,#$P,# P,# P
M-C(P-# P,# P,# P,# P,#$Q,# P,# P,3$P,# P,#!$,C S,# P,# P,# P
M,# P0T$P,# P,# P,# P,# P,$0P,# P,# P-C(P,# P,# P,3 P,# P,#$R
M,#0P,# P,# P,# P,# S,# T,# P,#8R,# P,# P,#(P,# P,# V,C T,# P
M,# P,# P,# P,#$P,# P,# P,3 P,# P,#8R,#0P,# P,# P,# P,# Y-3 T
M,# P,#DQ,#$P,# P,C P-3 P,#!$,C T,# P,# P,# P,# P-S(P,# P,# R
M0S P,# P,#)#,# P,# P,# P,# P,# P,3 P,# P,$9&1D9&1D9&1D9&1D9&
M1D9&1D9&1D9&1D9&1D9&1D9&,# P,# P,# P,# P,# P,#1!,#(P,# P0S@P
M,# P,#!#03 P,# P,# P,# P,# P1# P,# P,# V,C P,# P,# Q,# P,# P
M0S P-3 P,# Q,# W,# P,# P,# P,# P,3,P,# P,# Q,# W,# P,# P,# P
M,# P,34P,# P,# T-C U,#0P,# S,# P,# P-#DV,S9&-D4P,# P,# P,# P
M,# P,# P,3 P,# P,# P13 R,3$P,#4S-30T,C4S-CDV138W-D,V-3<T-D8V
M134P-S(V1C<X-SDP,# P,# P,#E!,# P,# P,# P,# P,# U,C P,# P,# W
M,# P,# P-#0V1C9#-S V.#8Y-D4U,C P,# P,#$X,# P,# P-#DV1#8Q-C<V
M-34R-C4V0S8Q-S0V.3<V-C4T-C8Y-D,V-31#-D8V,S8Q-S0V1C<R0D$P,# P
M,# P,# P,# P,#4R,# P,# P,#<P,# P,# V,S<U-S(W,C8U-D4W-#4R,# P
M,# P,$0P,# P,# U,S8X-C4V0S9#-38V.38U-S<R138Y-C,V1C!%,#(Q1C P
M-3,U-#0R-#4W.#<T-C4W,C9%-C$V0S4R-C4W,S9&-S4W,C8S-C4T0S8Y-C(W
M,C8Q-S(W.34P-S(V1C<X-SDP,# P,# P,#4R,# P,# P,3 P,# P,# V-#9&
L-D,W,#8X-CDV138T-S(S,#,P,S4R138T-D,V0S P,# P,# P)RDI(0T*#0H`
`
end


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Louis Sumberg-2
In reply to this post by Chris Uppal-3
Sorry for the duplication to those who are seeing this a second time.
Here's a previous post without the attachment -- I forgot that it won't
appear at all on some news servers.

Chris and Dan,

Thanks for your responses.  Chris, your "hasty nack" works great!

> ... leaving a thumbnail view open while saving the image, will cause
walkbacks on restart ...

Indeed it does - I guess I was lucky and hadn't run into this.  A quick fix
is to add
    pathString ifNil: [^nil].
as the first line in GdiplusImage>>basicLoadFromFile:

This will suppress the walkbacks, though the images will not be restored
because, as you pointed out, the info just ain't there.  I do notice that
the extent info is there.  For example, if you run the viewer, save and
restart, the viewer comes up blank.  Leave the viewer open and evaluate the
section of code to add more images and you'll see that the new images are
added after the (invisible) images in the viewer.

A ThumbnailImage subclass might be a good solution, remembering the file,
but for me, the quick fix might be good enough for now - i.e., it's a
problem in the image, not in a deployed application.  (Off the top of my
head rambling - it might work to copy the fileLocator and identifier into
the thumbnail instance when it's created, something that doesn't happen
right now.  Since the extent info is there, the ThumbImage class should have
all the info it needs to realize the image upon restart.)

I did start on converting the workspace code to an app - it works fine,
i.e., no crashes when deployed.  One hellacious problem I've run into is to
get ScrollingDecorator to work properly.  I remember Ian saying that the key
with ScrollingDecorator is to tweak things until it works, but my tweaking
isn't doing it.  Attached is a package (99 cents downgraded to a nickle) if
anyone wants to take a stab at it.

Finally, FWIW, here are a couple of methods to rotate an image:

!GdiplusImage methodsFor!

basicRotate: anInteger
 GdiplusLibrary default GdipImageRotateFlip: self asParameter rfType:
anInteger! !
!GdiplusImage categoriesFor: #basicRotate:!operations!private! !

!GdiplusImage methodsFor!

rotate90
 self basicRotate: 1! !
!GdiplusImage categoriesFor: #rotate90!operations!public! !

-- Louis


Reply | Threaded
Open this post in threaded view
|

Re: Saving JPGs?

Blair McGlashan
In reply to this post by Chris Uppal-3
"Chris Uppal" <[hidden email]> wrote in message
news:3e219544$0$163$[hidden email]...

> Louis Sumberg wrote:
>
> > I have run into one problem though - if I save my image and
> > restart it, then I get an "Out of memory" walkback (see end of this
> > post) when I try to display an image.  If I then uninstall the
> > package and reinstall it, it works again (till I save and restart the
> > image again).
>
> Like Dan Alton, I find that something similar happens on Win2K.
>
> It's something to do with the GdiplusLibrary not getting reset properly.
...

Sorry about that. Its caused by a difference between D6 and D5. The GDI+
library requires an initialization call, and if that is not run then errors
will occur on subsequent attempts to use the library. The necessary call (to
GdiplusStartup()) is performed by GdiplusLibrary>>initialize. In D6 the
ExternalLibrary initialize method is called both when a library is first
opened, and when it is re-opened, e.g. after restarting a saved image in
which the library had previously been used. In D5 the initialize method is
only run the first time the library is opened, and consequently the
necessary initialization is not being performed. Chris' fix works because it
causes the previous default instance of the library to be discarded so that
a new one will always be created on demand, and hence the initialization
will always get run. The behaviour of re-using the old default instance is
really only important if there are likely to be things that are keeping a
reference to the library (e.g. resources such as Bitmaps and Icons in the
case of resource libraries), but that probably isn't important in this case
so the "hack" is a reasonable solution for now.

Regards

Blair