TIFF to array

In fact, with your macro, when I run it using AClic, I get image3.png but it shows only one pad. Is that what you see also ?

Yes, that is the problem. Sorry that I was in a hurry this morning and did not mention it earlier.

In the mean time, I’ve tested many versions available on afs and as I see the problem started from Root 5.15.02. Thanks.

  • Subir

I have not yet found how to fix this. I think I have reduced your problem in a really small macro which is:

void pad2gif()
{
   gROOT->SetBatch();   

   TCanvas *c = new TCanvas;  
   c->Divide(1,2);  
   TH1F *h = new TH1F("gaus", "gaus", 100, -5, 5);
   h->FillRandom("gaus", 10000);
   c->cd(1); h->Draw();
   c->cd(2); h->Draw("c*");

   c->Print("ccc1.gif");   

   TImage *img = TImage::Create();
   img->FromPad(c);
   img->WriteImage("ccc2.gif");   
}

with the current version ccc2.gif has only one pad drawn (the second one where the 1st one should be). ccc1.gif is ok. I tried with an old version I found on afs (5.10). With that version ccc1.gif and ccc2.gif are the same. The two pad are at the right places. There issome others problems but at least not that one. The same macro without SetBatch() run just fine.

More info: found that the problem appeared in 5.15.02. The previous version 5.14.00i was correct.

Hi,

For standalone applications we are indeed using 5.14.00i. However, applications within the cms framework require > 5.18.00.

Should we go back to the file based option? When do you feel a fix will be implemented? png-on-the-fly has become very useful for ajax-based applications.
I was in fact going to request the same behavior for other formats like pdf and svg.
But, this is clearly not the right time.

Thanks a lot.

  • Subir

We are working on this. Not fixed yet.

This problem should be now fixed in the svn trunk. I used the following macro as test:


{
   gROOT->SetBatch();

   TCanvas *c = new TCanvas;
   c->Divide(1,2);
   TH1F *h = new TH1F("gaus", "gaus", 100, -5, 5);
   h->FillRandom("gaus", 10000);
   c->cd(1); h->Draw();
   c->cd(2); h->Draw("c*");
   c->Print("ccc1.gif");
   TImage *img = TImage::Create();
   img->FromPad(c);
   img->WriteImage("ccc2.gif");
}