Re: Convert Picture Crashing 4D

2017-02-09 Thread Nigel Greenlee
Sannyasin

Did you try 

SET PICTURE TO PASTEBOARD ? with the crashing pictures. If that does not crash 
that might give you an option(get clipboard data..etc etcif it does i think 
if you can’t then resolve it using Brunos' picture analysis code you will need 
to kiss them records goodbye. 

Good luck.

Nigel

> On 9 Feb 2017, at 02:14, Sannyasin Siddhanathaswami  wrote:
> 
> Aloha,
> 
> Thanks Nigel, and all. Even exporting the picture also causes a crash on some 
> of the pictures.
> 
> I’ll do some more testing.
> 
> In answer to Charles’s questions, both server and client are on a Mac, so 
> quicktime is installed by default. I don’t see how to determine if a picture 
> is compressed.
> 
> I’ll try these things next:
> Convert to PNG. If that works, convert again to JPG
> Try PICTURE to BLOB, then BLOB to PICTURE instead of CONVERT PICTURE
> Try the obsolete " _o_QT COMPRESS PICTURE”
> 
> I’ll let you all know what works for these funky pictures.
> 
> 
> Sannyasin Siddhanathaswami
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Convert Picture Crashing 4D

2017-02-08 Thread Sannyasin Siddhanathaswami
Missed this first time around. I’ll try this first to see what’s up with the 
pictures!

Sannyasin Siddhanathaswami


On 7 Feb 2017, at 09:54, Bruno LEGAY  wrote:

Hi,

Take a look here :
http://forums.4d.fr/Post/FR/17329223/1/17329529#17329529

It is 4D code to parse internal 4D picture format (and extract the various 
original format picture data).

You can test it to see what's wrong with your pictures…
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Convert Picture Crashing 4D

2017-02-08 Thread Sannyasin Siddhanathaswami
Aloha,

Thanks Nigel, and all. Even exporting the picture also causes a crash on some 
of the pictures.

I’ll do some more testing.

In answer to Charles’s questions, both server and client are on a Mac, so 
quicktime is installed by default. I don’t see how to determine if a picture is 
compressed.

I’ll try these things next:
Convert to PNG. If that works, convert again to JPG
Try PICTURE to BLOB, then BLOB to PICTURE instead of CONVERT PICTURE
Try the obsolete " _o_QT COMPRESS PICTURE”

I’ll let you all know what works for these funky pictures.


Sannyasin Siddhanathaswami


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Convert Picture Crashing 4D

2017-02-07 Thread Nigel Greenlee
Bruno.

Nice code.-solid bit of work there..don't mind if I take a copy do you.

Nigel Greenlee


> On 7 Feb 2017, at 09:54, Bruno LEGAY  wrote:
> 
> Hi,
> 
> Take a look here :
> http://forums.4d.fr/Post/FR/17329223/1/17329529#17329529
> 
> It is 4D code to parse internal 4D picture format (and extract the various 
> original format picture data).
> 
> You can test it to see what's wrong with your pictures…
> 
> HTH
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Convert Picture Crashing 4D

2017-02-07 Thread Nigel Greenlee
Sannyasin

Sorry i should have been more explanatory there..something like this(this all 
assumes the picture does load in the record)

$Path:=System folder(Documents folder)
$Path:=$Path+"Pictures"
If (Test path name($Path)#Is a folder)
CREATE FOLDER($Path)
End if 
$OutPath:=$path+Folder separator+"Converted_Pictures"
If (Test path name($OutPath)#Is a folder)
CREATE FOLDER($OutPath)
End if 
$OutPath:=$OutPath+Folder separator
ALL RECORDS([TABLE])
PICTURE CODEC LIST($Codecs;$Names)

For ($i;1;Records in selection([TABLE]))
If (Picture size([TABLE]Picture_pic)>0)
$_t_DocName:=[TABLE]RECORDIDSTRING

PICTURE TO BLOB([TABLE]Picture_pic;$_aPicBlob;".jpg”)<-if this does not work 
try something else
$doc:=Create document($Path+Folder separator+$_t_DocName+".jpg")
CLOSE DOCUMENT($doc)
BLOB TO DOCUMENT($Path+Folder separator+$_t_DocName+".jpg";$_aPicBlob)
$PosixPath:=Convert path system to POSIX($Path+Folder 
separator+$_t_DocName+".jpg")
$OutPosixPath:=Convert path system to POSIX($OutPath+$_t_DocName+".png")
$_t_Script:="sips -s format png "+$PosixPath+"  --out "+$OutPosixPath
LAUNCH EXTERNAL PROCESS($_t_Script)
end if
//here you would get the image from the new document back into the record if 
that is what you are planning to do
NEXT RECORD([TABLE])

End for 

I cant say if that will be any better-but if this will convert the picture(or 
even just export it in JPEG format) then you can open the image in preview and 
if it is loading there can then bring the JPEG back into the record.

> On 7 Feb 2017, at 09:36, Nigel Greenlee  wrote:
> 
> Sannyasin
> 
> Hi-if you having trouble with 4D crashing it you might consider exporting the 
> picture in the what ever format it currently is and then using LEP to call 
> the command line to convert it to a JPG, then you can re-import the new 
> picture.
> 
> https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/sips.1.html
>  
> 
> 
> Nigel Greenlee
> 
> 
> 
>> On 6 Feb 2017, at 22:02, Sannyasin Siddhanathaswami  wrote:
>> 
>> Aloha,
>> 
>> We are starting the preparations for v16, and dealing with the picture 
>> issues. Let’s just say we have tons of ancient photos in our database! We 
>> are currently using v15.3 on a Mac (server - client).
>> 
>> Basically, we are trying to convert all pictures to jpg. Unfortunately, 
>> doing this crashed 4D:
>> CONVERT PICTURE([Members]Picture;".jpg";0.8)
>> 
>> Even putting the picture field into a variable before converting crashes 
>> during the “Convert Picture.” It’s not all picture, just many of them. By 
>> crash, the 4D.app just quits to the desktop with a crash report.
>> 
>> I can view these pictures just fine in an input form. If I copy the picture 
>> out of the input form, into another app, then back in, the conversion works 
>> fine.
>> 
>> Anyone have any tips on how to approach this? If I run the method to execute 
>> on server, the whole server crashes…
>> 
>> Thanks,
>> 
>> 
>> Sannyasin Siddhanathaswami
>> **
>> 4D Internet Users Group (4D iNUG)
>> FAQ:  http://lists.4d.com/faqnug.html
>> Archive:  http://lists.4d.com/archives.html
>> Options: http://lists.4d.com/mailman/options/4d_tech
>> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
>> **
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Convert Picture Crashing 4D

2017-02-07 Thread Nigel Greenlee
Sannyasin

Hi-if you having trouble with 4D crashing it you might consider exporting the 
picture in the what ever format it currently is and then using LEP to call the 
command line to convert it to a JPG, then you can re-import the new picture.

https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/sips.1.html
 


Nigel Greenlee



> On 6 Feb 2017, at 22:02, Sannyasin Siddhanathaswami  wrote:
> 
> Aloha,
> 
> We are starting the preparations for v16, and dealing with the picture 
> issues. Let’s just say we have tons of ancient photos in our database! We are 
> currently using v15.3 on a Mac (server - client).
> 
> Basically, we are trying to convert all pictures to jpg. Unfortunately, doing 
> this crashed 4D:
> CONVERT PICTURE([Members]Picture;".jpg";0.8)
> 
> Even putting the picture field into a variable before converting crashes 
> during the “Convert Picture.” It’s not all picture, just many of them. By 
> crash, the 4D.app just quits to the desktop with a crash report.
> 
> I can view these pictures just fine in an input form. If I copy the picture 
> out of the input form, into another app, then back in, the conversion works 
> fine.
> 
> Anyone have any tips on how to approach this? If I run the method to execute 
> on server, the whole server crashes…
> 
> Thanks,
> 
> 
> Sannyasin Siddhanathaswami
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Convert Picture Crashing 4D

2017-02-06 Thread Keisuke Miyako
this really depends on the nature of the picture.

PNG compresses bitmap without losing any information.

JPEG is a more heuristic kind of algorithm for natural photos,
where similar colours blend into each other
but contrasting colours can create ugly pixels on the edges.

2017/02/07 10:03、Charles Miller 
> のメール:
5. Also I would not go to PNG, we have found that when converting to PNG 
pictures get huge, what was 1.2 meg as a pict in 4D can become 20 meg as a png



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Convert Picture Crashing 4D

2017-02-06 Thread Charles Miller
We have found many problems with running convert many pictures using v15.x 
(1,2,and 3). 

Make sure as others have said that
1. Quick time enabled on server
2. Quick time installed-
3. check to see if picture compressed and if so uncompress first
4 Run on client not server.
5. Also I would not go to PNG, we have found that when converting to PNG 
pictures get huge, what was 1.2 meg as a pict in 4D can become 20 meg as a png

6. Another option is to print to pdf and then use acrobat professional or some 
other tool to convert to jpeg and any other format of you choice. Doing this 
means you will have to name files and then re-import same

7. You might also try write picture file and then read it and convert form there

FYI we have over 500,000 pictures that we had to convert

Regards

Chuck

 Chuck Miller Voice: (617) 739-0306
 Informed Solutions, Inc. Fax: (617) 232-1064   
mailto:miller.cjaygmail.com 
 Brookline, MA 02446 USA Registered 4D Developer
   Providers of 4D and Sybase connectivity
  http://www.informed-solutions.com  



> On Feb 6, 2017, at 6:22 PM, Keisuke Miyako  wrote:
> 
> if the picture contains multiple formats,
> including the format you specified,
> the command simply uses the existing copy.
> 
> to really force a conversion, you might want to avoid JPEG
> 
> 2017/02/07 7:02、Sannyasin Siddhanathaswami 
> > のメール:
> CONVERT PICTURE([Members]Picture;".jpg";0.8)
> 
> 
> 
> **
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: http://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **

**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Convert Picture Crashing 4D

2017-02-06 Thread Keisuke Miyako
if the picture contains multiple formats,
 including the format you specified,
the command simply uses the existing copy.

to really force a conversion, you might want to avoid JPEG

2017/02/07 7:02、Sannyasin Siddhanathaswami 
> のメール:
CONVERT PICTURE([Members]Picture;".jpg";0.8)



**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: Convert Picture Crashing 4D

2017-02-06 Thread Keisuke Miyako
sounds like the header of the JPEG (or maybe it's QuickTime, who knows...) has 
a bad offset value.

are you using a 32-bit version of 4D?
is QuickTime activated?
does it really have to be JPEG (as opposed to, say, PNG)?
do you really need to apply compression?

why not call GET PICTURE FORMATS before you apply the conversion on the 
suspicious picture?
http://doc.4d.com/4Dv16/4D/16/GET-PICTURE-FORMATS.301-2925150.en.html

2017/02/07 7:02、Sannyasin Siddhanathaswami 
> のメール:
I can view these pictures just fine in an input form. If I copy the picture out 
of the input form, into another app, then back in, the conversion works fine.
Anyone have any tips on how to approach this? If I run the method to execute on 
server, the whole server crashes…


**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Convert Picture Crashing 4D

2017-02-06 Thread Sannyasin Siddhanathaswami
Aloha,

We are starting the preparations for v16, and dealing with the picture issues. 
Let’s just say we have tons of ancient photos in our database! We are currently 
using v15.3 on a Mac (server - client).

Basically, we are trying to convert all pictures to jpg. Unfortunately, doing 
this crashed 4D:
CONVERT PICTURE([Members]Picture;".jpg";0.8)

Even putting the picture field into a variable before converting crashes during 
the “Convert Picture.” It’s not all picture, just many of them. By crash, the 
4D.app just quits to the desktop with a crash report.

I can view these pictures just fine in an input form. If I copy the picture out 
of the input form, into another app, then back in, the conversion works fine.

Anyone have any tips on how to approach this? If I run the method to execute on 
server, the whole server crashes…

Thanks,


Sannyasin Siddhanathaswami
**
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**