View Issue Details

IDProjectCategoryView StatusLast Update
0001406JEDI VCL00 JVCL Componentspublic2004-04-11 02:23
ReporterxerkanAssigned Touser72 
PrioritylowSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001406: Create dbImage with suport jpeg
DescriptionI would wonder if there was possible the creation of a component of the type dbimage that had support for the images of the type jpeg, since till now I them have to load one a TImage whenever it changes of record into the data base

The code that I use to load the jpeg in the TImage is the following one:

use jpeg;

procedure TfrmActualizarDatos.MostrarImagen;
var
    Jpeg:TJpegImage;
    Corriente:TMemoryStream;
begin
    with dtmUtilMenu do
    begin
        // Actualizamos la imagen
        if not cdsUtilMenuImagen.IsNull then
        begin
            Jpeg:=TJpegImage.create;
            Corriente:=TMemoryStream.create;
            cdsUtilMenuImagen.SaveToStream(Corriente);
            Corriente.Seek(0,soFromBeginning);
            Jpeg.LoadFromStream(Corriente);
            imgAplicacion.Picture.Assign(Jpeg);
            Corriente.Free;
            Jpeg.Free;
        end else
            imgAplicacion.Picture:=nil;

        // Actualiza el estado de los botones dependiendo si ahi o no imagen
        btnEliminarImagen.Enabled:=not cdsUtilMenuImagen.IsNull;
        btnGuardarImagen.Enabled:=not cdsUtilMenuImagen.IsNull;
    end;
end;

Additional InformationMe preguntaria si fuese posible la creacion de un componente del tipo dbimage que tuviera soporte para las imagenes del tipo jpeg, ya que hasta ahora tengo que cargarlas un un TImage cada vez que se cambia de registro en la base de datos

El codigo que uso para cargar el jpeg en el TImage es el siguiente:
........
TagsNo tags attached.

Activities

user72

2004-03-02 10:37

  ~0003154

This will get a very low priority. Feel free to implement yourself and donate :)

anonymous

2004-03-03 16:18

viewer   ~0003167

There is some one at Borland's codecentral. I dont remember the exact id nor with what text the search engine give me the hit. It works with other graphic formats guessign the graphic type inspecting the first bytes of the blob contents. It works fairly well when I tested it. AFAIR it uses Borland's code snipets that could cause problems because copyrigth.

user72

2004-03-04 10:28

  ~0003196

I found these:
http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=15936
http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=18054
http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=13229

You could use one of those instead...

xerkan

2004-03-07 15:10

reporter   ~0003255

After proving the components that you have put, the fact that more me taste was 18054, it included his code source for if they want to see it.

Also I include the code source of this component modified by me in order that he adapts himself better to my needs, the modifications done apart from having changed the name are:

- Support for png and gif (the components gifimage.pas and pngimage.pas, I them have extracted of his project "JVCL3-2004-03-07.zip")

- Property ImageType that there brings the type of image that stores the component

- Properties ShrinkToFit and ZoomToFit which belong to the same component but of a top version

xerkan

2004-03-07 15:13

reporter   ~0003256

I forgot to indicate it, the file EDBImageX6.zip is that of the original component while dcDBImage.zip is the modification

user72

2004-04-02 11:06

  ~0003602

If you have a working dbimage with jpeg that you can donate to JVCL (you cannot donate other peoples code without their permission), please attach it to this report.

I don't see us doing this ourselves any time soon.

xerkan

2004-04-02 14:22

reporter   ~0003612

I spoke with the author of the original components (which are free) and be if that agreed in donating his components to the project JVCL, I the only thing that I put they are a few components based on theirs but with reforms created by me.

They can get in touch with the creator of the components by means of his e-mail (DelphiHelper@yahoo.com.ar) to ask for his conformity.

anonymous

2004-04-07 12:29

viewer   ~0003688

I got interested in this issue.
I check Borland's code and see that it is minor changes to check blob contents and create correct picture class. But I dont known if this is valid since is Borlan's code.

Sugestions? Comments?

user72

2004-04-07 12:40

  ~0003691

How much of the Borland code do you actually need to include? How much of it is generic?

anonymous

2004-04-07 13:04

viewer   ~0003693

As far as I see, It must be changed only LoadPicture and UpdateData methods. All the code can remain unchanged.

I dont remenber what Borland said about using his code.

anonymous

2004-04-07 13:06

viewer   ~0003694

By the way, is this the best way to communicate?
I can post to the news group or e-mail you directly.

user72

2004-04-07 13:11

  ~0003696

Don't e-mail me directly,please. Post here or in the newsgroup, whatever seems more appropriate to you.

anonymous

2004-04-07 13:16

viewer   ~0003697

I'm working on the component. I already named TJvDBImage. I will see if it works as I think. But...

I'm using Borland's code as base.
It will be enougth to said that portions of the code was writen by Borland or cant be added to JVCL because licensing?

user72

2004-04-07 13:17

  ~0003698

I would have to compare the units to decide

2004-04-07 17:37

 

JvDBImage.zip (4,797 bytes)

anonymous

2004-04-07 17:37

viewer   ~0003706

I'm uploading JvDBImage. Please check if it is possible to add to JVCL. If is possible I will create the DCR file.

Now what It does:
- Suppor for JPG, GIF (depending on USE_JV_GIF), ICO, WMF, EMF.
- Also support any TGraphic. You must register the signature via RegisterGraphicSignature. This means that if you use another TGraphic descendentan (such TPNGObject or other image library) there is no need to modify the component.
- OnGetGraphicClass event fired before the image is loaded from blob field. This is a little redundant since programmer can register sigantures but FWIW.

user72

2004-04-08 04:42

  ~0003711

Thanks, will have a look during Easter weekend.

2004-04-08 05:56

 

JvDBImageReduced.zip (3,025 bytes)

user72

2004-04-08 05:56

  ~0003715

I've uploaded a new unit with all the Borland code removed. Please try if it works (can't test it myself at the moment)

anonymous

2004-04-08 08:19

viewer   ~0003718

With my test bed, It works. Of course need more testing.
I added Proportional and change some other things (in my code).
I will merge my changes with your changes, test and upload again.
Ok?

anonymous

2004-04-08 08:46

viewer   ~0003720

What delphi version you use?

user72

2004-04-08 08:46

  ~0003721

I have also tested now and there is still some issues that I have fixed. I can upload again and you can merge or you uplaod and I merge. Your choice.

user72

2004-04-08 09:02

  ~0003722

>What delphi version you use?
I have D5-D7 Ent installed

anonymous

2004-04-08 09:11

viewer   ~0003723

Please upload. I will merge.
By the way, I have already made the bitmap for this component.
I made only modifications over your code. This means that can be included in JVCL?
Thanks.

About Delphi:
What is the minimun Delphi version which must be supported by JVCL?. I recently drop D6 and only work with D7.

2004-04-08 09:52

 

JvDBImageWithDemo.zip (21,665 bytes)

user72

2004-04-08 09:53

  ~0003731

> I made only modifications over your code.
> This means that can be included in JVCL?
The code as it is now doesn't contain anything from Borland, so should be fine
> What is the minimun Delphi version which must be supported by JVCL?.
Delphi 5 and BCB 5

I've attached the modified code and a demo that I am using to test it. Please merge and upload again.

BTW, what's your name?

anonymous

2004-04-08 10:35

viewer   ~0003736

My name is Sergio Samayoa (sergiosamayoa[at]icon.com,gt)

I just merging your code.
It will be necesary to override other methods since I change PasteFromClippboard and, when control respond to ^V, new method must be called.

user72

2004-04-08 10:43

  ~0003737

I've removed the original dbImage attachements since they are of no consequence anymore

2004-04-08 11:31

 

JvDBImage.zip (5,496 bytes)

anonymous

2004-04-08 11:37

viewer   ~0003739

I just upload the latest TJvDBImage (dated 04-08-04).
It includes the bitmap for the component.

I think that is *almost* ready for use. I tested it with IBX.
With BDE DOESNT WORK!! (at least with TTable).
I dont known if worth the effort to find why doesnt work.

Appart from support for other image formats I also added Proportional property.

I will be offline from now until saturdad or monday.

Regards.

user72

2004-04-08 13:53

  ~0003749

> With BDE DOESNT WORK!!
Fixed. Also added Transparent and AutoSize properties. I will add this to JVCL in the next day or so after I've tested it in design mode and with D5.

user72

2004-04-09 06:01

  ~0003754

I've now tested with D5 as well and added the component to JVCL. Thanks for the donation!

anonymous

2004-04-10 08:36

viewer   ~0003786

Hi Peter.
You shouldnt thank me since you did almost all.
Regards.

user72

2004-04-10 12:28

  ~0003788

> You shouldnt thank me since you did almost all.
That's not fair. You provided the code that actually does something - loads other images but bmp and ico.

To me, that's teamwork at its best: I hadn't been able to do it without you and you might not have been able to remove the Borland code by yourself, so we both provided essential parts to the whole.

Either way, it's a great component!

user72

2004-04-11 02:23

  ~0003795

Since the component is now in JVCL, we can close this report

Issue History

Date Modified Username Field Change
2004-03-01 11:50 xerkan New Issue
2004-03-02 10:37 user72 Note Added: 0003154
2004-03-02 10:37 user72 Priority normal => low
2004-03-02 10:37 user72 Status new => acknowledged
2004-03-03 16:18 anonymous Note Added: 0003167
2004-03-04 10:28 user72 Note Added: 0003196
2004-03-07 15:10 xerkan Note Added: 0003255
2004-03-07 15:11 xerkan File Added: EDBImageX6.zip
2004-03-07 15:11 xerkan File Added: dcDBImage.zip
2004-03-07 15:13 xerkan Note Added: 0003256
2004-04-02 11:06 user72 Note Added: 0003602
2004-04-02 11:06 user72 Status acknowledged => feedback
2004-04-02 14:22 xerkan Note Added: 0003612
2004-04-07 12:29 anonymous Note Added: 0003688
2004-04-07 12:40 user72 Note Added: 0003691
2004-04-07 13:04 anonymous Note Added: 0003693
2004-04-07 13:06 anonymous Note Added: 0003694
2004-04-07 13:11 user72 Note Added: 0003696
2004-04-07 13:16 anonymous Note Added: 0003697
2004-04-07 13:17 user72 Note Added: 0003698
2004-04-07 17:37 anonymous File Added: JvDBImage.zip
2004-04-07 17:37 anonymous Note Added: 0003706
2004-04-08 04:42 user72 Note Added: 0003711
2004-04-08 05:56 user72 File Added: JvDBImageReduced.zip
2004-04-08 05:56 user72 Note Added: 0003715
2004-04-08 08:19 anonymous Note Added: 0003718
2004-04-08 08:46 anonymous Note Added: 0003720
2004-04-08 08:46 user72 Note Added: 0003721
2004-04-08 09:02 user72 Note Added: 0003722
2004-04-08 09:11 anonymous Note Added: 0003723
2004-04-08 09:52 user72 File Added: JvDBImageWithDemo.zip
2004-04-08 09:53 user72 Note Added: 0003731
2004-04-08 10:35 anonymous Note Added: 0003736
2004-04-08 10:42 user72 File Deleted: EDBImageX6.zip
2004-04-08 10:42 user72 File Deleted: dcDBImage.zip
2004-04-08 10:43 user72 Note Added: 0003737
2004-04-08 10:44 user72 Status feedback => assigned
2004-04-08 10:44 user72 Assigned To => user72
2004-04-08 11:31 anonymous File Added: JvDBImage.zip
2004-04-08 11:37 anonymous Note Added: 0003739
2004-04-08 13:53 user72 Note Added: 0003749
2004-04-09 06:01 user72 Note Added: 0003754
2004-04-10 08:36 anonymous Note Added: 0003786
2004-04-10 12:28 user72 Note Added: 0003788
2004-04-11 02:23 user72 Status assigned => resolved
2004-04-11 02:23 user72 Resolution open => fixed
2004-04-11 02:23 user72 Note Added: 0003795