Re: [Lazarus] about TDFB

2011-12-08 Thread Graeme Geldenhuys
 8 December 2011 14:19, Vincent Snijders <> wrote:
>
> I wonder: why base64 encode the image in the first place? I thought it
> was to make plain ascii, suitable for a text field.
>
> Then I don't understand how you can keep it plain ascii (no null
> characters, for example), if you gzip it.


Well spotted Vincent. The order must be the other way round. gzip
first, then base64 encode it, before storing in a text field in DB.
The same process gets done when we transmit binary data via XML over
HTTP in our multi-tier setup.


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about TDFB

2011-12-08 Thread Vincent Snijders
2011/12/7 Graeme Geldenhuys :
> 2011/12/7 Ing. Héctor F. Fiandor Rosario :
>>
>> thanks very much,
>
> My pleasure. If you are storing *.bmp files, they are uncompressed
> images (always I think), so can be rather large. If storage size might
> be a problem, I would then suggest you base64 encode the image, then
> gzip the base64 tex, then store in a field. This reduces the storage
> size considerably. This is what I use in some of my projects.

I wonder: why base64 encode the image in the first place? I thought it
was to make plain ascii, suitable for a text field.

Then I don't understand how you can keep it plain ascii (no null
characters, for example), if you gzip it.

Vincent

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about TDFB

2011-12-08 Thread Ing . Héctor F . Fiandor Rosario

Dear Mr. Geldenhuys:

thanks very much.

Now I have already prepared a Report (LazReport) and I have added a "tipo" 
field coding de Sex+HairColor+SkinColor+YearBorn+MonthBorn thinking in an 
auxiliary index for ordering.


I have to learn a lot about how to do queries.  In Access it is easy.

Thanks again,

Ing. Héctor F. Fiandor Rosario
hfian...@infomed.sld.cu

- Original Message - 
From: "Graeme Geldenhuys" 

To: "Lazarus mailing list" 
Sent: Thursday, December 08, 2011 1:28 AM
Subject: Re: [Lazarus] about TDFB



On 7 December 2011 23:22, Ing. Héctor F. Fiandor Rosario
 wrote:


I am using the jpg images and obtain the same results.


In that case the jpg file is already in a compressed form, so using
base64 + gzip will not gain much. Using a standard BLOB field (like
you already do) is fine in this case.



--
Regards,
- Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus




--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about TDFB

2011-12-07 Thread Graeme Geldenhuys
On 7 December 2011 23:22, Ing. Héctor F. Fiandor Rosario
 wrote:
>
> I am using the jpg images and obtain the same results.

In that case the jpg file is already in a compressed form, so using
base64 + gzip will not gain much. Using a standard BLOB field (like
you already do) is fine in this case.



-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about TDFB

2011-12-07 Thread Ing . Héctor F . Fiandor Rosario

Dear Mr. Geldenhuys:

really your comments are good lessons for me, but I have to admits that my
knowledges are so limited and can´t understand.

how to encode an image?
how to do gzip?
it´s correct to use de blob as field?

I am using the jpg images and obtain the same results.

if you understand that this answer are not suittable to the list, you can
use my email,.

thanks in advance,

Ing. Héctor F. Fiandor Rosario
hfian...@infomed.sld.cu


--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about TDFB

2011-12-07 Thread Graeme Geldenhuys
2011/12/7 Ing. Héctor F. Fiandor Rosario :
>
> thanks very much,

My pleasure. If you are storing *.bmp files, they are uncompressed
images (always I think), so can be rather large. If storage size might
be a problem, I would then suggest you base64 encode the image, then
gzip the base64 tex, then store in a field. This reduces the storage
size considerably. This is what I use in some of my projects.


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] about TDFB

2011-12-07 Thread Graeme Geldenhuys
2011/12/6 Ing. Héctor F. Fiandor Rosario:
>
> I am trying to do a program with TDbf for actors´casting and I want to
> include a photo of the actor.

Store the photo as a binary blob (I think DBF supports BLOB fields).
Otherwise base64 encode the image, then store it as a large varchar()
field.


-- 
Regards,
  - Graeme -


___
fpGUI - a cross-platform Free Pascal GUI toolkit
http://fpgui.sourceforge.net

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] about TDFB

2011-12-06 Thread Ing . Héctor F . Fiandor Rosario

Dear friends:

I am trying to do a program with TDbf for actors´casting and I want to 
include a photo of the actor.


How can I do that?

thanks in advance for your answering,

yours,

Ing. Héctor F. Fiandor Rosario
hfian...@infomed.sld.cu


--

Este mensaje le ha llegado mediante el servicio de correo electronico que 
ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema 
Nacional de Salud. La persona que envia este correo asume el compromiso de usar 
el servicio a tales fines y cumplir con las regulaciones establecidas

Infomed: http://www.sld.cu/

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus