Author Topic: fPDF printing error in Category listings  (Read 36032 times)

akerman

  • Jr. Member
  • **
  • Posts: 325
  • Knowledge weighs Nothing!
    • STOLT/AKERMAN
fPDF printing error in Category listings
« on: April 17, 2008, 08:40:09 am »
Searched all Forum for PDF solutions and found several solutions spread over the last two years. None of them solved this.

Environment: Jomla! 1.5.2, VM 1.1.0 RC3

Problem
Using PDF button in a category listing (like 'Handtools') produce erroneous result in popup window.

Error code inside popup window (no 'application/pdf' text in window header)
FPDF error: Alpha channel not supported: http://www.mysite.com/components/com_virtuemart/themes/default//images/feed-icon-14x14.png

Comparison
PDF function on product detail is working.

Conclusion
This leads me to belive that FPDF have some kind of problem w PNG files.
Which also is proven by removal/renaming off the feed_icon...png to feed_icon...pog. = Voilá the PDF works!

Any solution? Has this not been discovered before?

Regards
Akerman / InfoClip.se
http://STOLT-AKERMAN.com - Web & Design agency. Spemildt in e-shop, ecommerce and marketing.
http://InfoClip.se - Swedish Antique & Used Books & Art Shop.
http://AkermansCove - Personal Portfolio
Ubuntu LAMP / Joomla 1.5.22 / VM 1.1.6 / JoomFish Contributor / Developer / Designer

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27426
  • Always on vacation
    • Jenkin Hill Internet
Re: PDF error in Category listings
« Reply #1 on: April 17, 2008, 21:06:19 pm »
It does not error for me J!1.5.2  VM build 1371 using FireFox 2.0.0.13
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.3.10057 on Joomla 3.9.8 PHP 7.0.33
Testing VM .3.6.0.10075 on Joomla 3.9.8

akerman

  • Jr. Member
  • **
  • Posts: 325
  • Knowledge weighs Nothing!
    • STOLT/AKERMAN
Re: PDF error in Category listings
« Reply #2 on: April 18, 2008, 16:36:58 pm »
Hmm, interesting I'm also using that version off Firefox.

Although I don't think the problem is with the browser. The error message clearly states that the FPDF has problem to read the file due to 'Alpha channe is not supportedl'. Alpha channel is a part of the PNG file structure.

Removing / renaming the file or replacing the PNG with GIF solves the problem. But since the RSS icon in this instance is delivered with the VM installation, one could expect that this should work.

Do you have the RSS feed icon active on the category page from where you test the PDF function?

Regards
Akerman / InfoClip.se
 
http://STOLT-AKERMAN.com - Web & Design agency. Spemildt in e-shop, ecommerce and marketing.
http://InfoClip.se - Swedish Antique & Used Books & Art Shop.
http://AkermansCove - Personal Portfolio
Ubuntu LAMP / Joomla 1.5.22 / VM 1.1.6 / JoomFish Contributor / Developer / Designer

aravot

  • Peter
  • Moderator
  • Sr. Member
  • *
  • Posts: 2874
    • VirtueMart Extensions
Re: PDF error in Category listings
« Reply #3 on: April 18, 2008, 17:28:01 pm »
Can not duplicate your issue, if you are using RC3 upgrade to nightly build.

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27426
  • Always on vacation
    • Jenkin Hill Internet
Re: PDF error in Category listings
« Reply #4 on: April 18, 2008, 17:34:31 pm »
Do you have the RSS feed icon active on the category page from where you test the PDF function?

Yes, I do. Tested with PHP 4.4.4 and 5.2.4 but issues can be related to PHP version.

I see no product images with 5.2.4, though. Using 5.2.4 with VM 1.0.15 I always get an error with .gif files, but not when using PHP 4. Something not quite right?

For client sites I usually turn off the pdf icon.
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.4.3.10057 on Joomla 3.9.8 PHP 7.0.33
Testing VM .3.6.0.10075 on Joomla 3.9.8

akerman

  • Jr. Member
  • **
  • Posts: 325
  • Knowledge weighs Nothing!
    • STOLT/AKERMAN
Re: [CAN NOT DUPLICATE] PDF error in Category listings
« Reply #5 on: April 18, 2008, 19:14:14 pm »
Ok, I will follow Aravot recommendation to run a later Nightly build or maybe wait ti'll after April 23rd? (.. if no more delays  ;)  )

I'm running PHP Version 5.2.3-1ubuntu6.3 and this problem have been with me since the first implementation of VM 1.1.0 RC1.
I was hoping for this to become solved during the development of the later RC's.

I'm no master programmer but I work professionally in the IT services and to my humble opinon it seems to be straightforward when it comes to the problemdetermination: FPDF does not like PNG format of the Feed icon included in the themes path.

The following code in the FPDF.php is processed until the point of the Alpha investigation (where it crashes)

Code: [Select]
function _parsepng($file)
{
//Extract info from a PNG file
$f=fopen($file,'rb');
//Extract info from a PNG file
if(!$f) $this->Error('Can\'t open image file: '.$file);
//Check signature
if(fread($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10))
$this->Error('Not a PNG file: '.$file);
//Read header chunk
fread($f,4);
if(fread($f,4)!='IHDR') $this->Error('Incorrect PNG file: '.$file);
$w=$this->_freadint($f);
$h=$this->_freadint($f);
$bpc=ord(fread($f,1));
if($bpc>8) $this->Error('16-bit depth not supported: '.$file);
$ct=ord(fread($f,1));
if($ct==0) $colspace='DeviceGray';
elseif($ct==2) $colspace='DeviceRGB';
elseif($ct==3) $colspace='Indexed';
else $this->Error('Alpha channel not supported: '.$file);       <-------------------- CRASH occurs here!!
if(ord(fread($f,1))!=0) $this->Error('Unknown compression method: '.$file);
if(ord(fread($f,1))!=0) $this->Error('Unknown filter method: '.$file);
if(ord(fread($f,1))!=0) $this->Error('Interlacing not supported: '.$file);
fread($f,4);
$parms='/DecodeParms <</Predictor 15 /Colors '.($ct==2 ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w.'>>';


I haven't changed the image or the code, its 'straight out of the box', so I think its odd that you guys don't experience the same problem.

Regards
Akerman / InfoClip.se

http://STOLT-AKERMAN.com - Web & Design agency. Spemildt in e-shop, ecommerce and marketing.
http://InfoClip.se - Swedish Antique & Used Books & Art Shop.
http://AkermansCove - Personal Portfolio
Ubuntu LAMP / Joomla 1.5.22 / VM 1.1.6 / JoomFish Contributor / Developer / Designer

iamalive

  • Jr. Member
  • **
  • Posts: 133
  • Life is good
    • Websites4U
Re: [CAN NOT DUPLICATE] PDF error in Category listings
« Reply #6 on: May 09, 2008, 15:16:14 pm »
Hi

I'm getting this error too:

Quote
FPDF error: Alpha channel not supported: /home/customer/public_html/components/com_virtuemart/shop_image/vendor/customer_47cd40af189d5.png

This now the live Site at: http://neukom-electronic.ch on all of the virtuemart pages.

My details:
Virtuemart 1.1 stable build from 23 April 2008
Joomla 1.5.3
PHP 5.2.5
MySQL 5.0.45-community
Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635

This error occurs with both Firefox 2.0.0.14
and IE 7

Regards
David
David Jakob
..stressfreie Webseiten von http://websites4u.ch...

iamalive

  • Jr. Member
  • **
  • Posts: 133
  • Life is good
    • Websites4U
Re: [CAN NOT DUPLICATE] PDF error in Category listings
« Reply #7 on: May 09, 2008, 16:49:36 pm »
Well I've investigated further:

It turns out that the logo which the shop uses, had aplpha transparency and now I've changed it to a jpg and that problem goes away. HOWEVER...

the next it thing it complined about was the feed image for the RSS link:
Quote
/themes/default/images/feed-icon-14x14.png
which also had alpha transparency.

So I converted that to something without transparency and the the next problem comes up:

Quote
FPDF error: Missing or incorrect image file: http://neukom-electronic.ch/components/com_virtuemart/shop_image/product/resized/resized%2FBK_Precision_879_47d5525f44cd9_90x90_90x90.jpg

Now I stop. It's clear that the PDF bit of Virtuemart which calls up FPDF needs to be able to work around all these limitations associated with images.

That's the bes information I can provide a input, folks.

Regards

David
David Jakob
..stressfreie Webseiten von http://websites4u.ch...

GTWillemsen

  • Guest
Re: [CAN NOT DUPLICATE] PDF error in Category listings
« Reply #8 on: May 12, 2008, 14:50:50 pm »
Is this problem already solved?

___

If not, maybe offer the option to choose not to display PNG images with alpha channels, but maybe show gif images instead, in the PDF?
Can be a workaround until this can be fixed?

___

It only happens with alpha channel PNG as far as I tested.
IMO it's not only a VM theme issue, but a problem for every alpha PNG...  thus for product imagery as well!

akerman

  • Jr. Member
  • **
  • Posts: 325
  • Knowledge weighs Nothing!
    • STOLT/AKERMAN
Re: [CAN NOT DUPLICATE] PDF error in Category listings
« Reply #9 on: May 14, 2008, 22:19:44 pm »
Thanx for the feedback guys!

This made the issue a bit clearer for me. I will test to replace the RSS icon (which is my immediate problem area) with a .gif instead or a .png without 'Alpha-channel'

Looking at the code again its quite clear that it does not support Alpha channel.
(Suppose I had tunnel-vision while reading it before... ;) )

Anyhow, some kind of adjustment in FPDF in regards of inserting/converting the most common filetypes, is most welcome.


Regards
Akerman
http://STOLT-AKERMAN.com - Web & Design agency. Spemildt in e-shop, ecommerce and marketing.
http://InfoClip.se - Swedish Antique & Used Books & Art Shop.
http://AkermansCove - Personal Portfolio
Ubuntu LAMP / Joomla 1.5.22 / VM 1.1.6 / JoomFish Contributor / Developer / Designer

conticreative

  • Jr. Member
  • **
  • Posts: 80
Re: [CAN NOT DUPLICATE] PDF error in Category listings
« Reply #10 on: September 14, 2008, 03:58:10 am »
Please take the [cannot duplicate] out since many of us can indeed duplicate it :)

I did not have the initial problem in the post but I started out with the problem outlined in iamalive post. Namely my error looks just like this one:

FPDF error: Missing or incorrect image file: http://neukom-electronic.ch/components/com_virtuemart/shop_image/product/resized/resized%2FBK_Precision_879_47d5525f44cd9_90x90_90x90.jpg

Now, if you take a good look at the filename it says it cannot find
BK_Precision_879_47d5525f44cd9_90x90_90x90.jpg

I'll bet my lunch that the original filename ended in _90x90 on the server and not _90x90_90x90.jpg
at least that's how it is on my server when I went to check the filenames.

In any event, this is a real problem for me and a solution would be nice.

Incidentally, I installed an update to FPDF (1.6) which solved the problem but then the page was blank.

SamTzu

  • Beginner
  • *
  • Posts: 46
  • I pressed the "Escape" key. Why am I still here?
    • Internet Content for everyone!
Re: fPDF printing error in Category listings
« Reply #11 on: March 17, 2009, 18:28:59 pm »
On your (ubuntu) server as a root try this..

apt-get install php-fpdf

Works for me.

--------------------------------------------
Sam
---------------------------------------------------------

Sam

SamTzu

  • Beginner
  • *
  • Posts: 46
  • I pressed the "Escape" key. Why am I still here?
    • Internet Content for everyone!
Re: fPDF printing error in Category listings
« Reply #12 on: October 20, 2010, 15:14:25 pm »
lol, Googled this again and found my own solution :)
Hurray for me.
---------------------------------------------------------

Sam

mus1402

  • Beginner
  • *
  • Posts: 35
Re: fPDF printing error in Category listings
« Reply #13 on: January 23, 2011, 07:20:35 am »
Is there any solution to this problem?

I'm having similar issue.

Pls help. thx
***><>*<>*<>*< DISCOVER the HIDDEN SECRET how 18yr old make thousands dollar monthly - http://tinyurl.com/HowToMakeMoneyOnFiverr >*<>*<>*<><***

cmatte

  • Beginner
  • *
  • Posts: 40
Re: fPDF printing error in Category listings
« Reply #14 on: April 30, 2011, 18:31:57 pm »
lol, Googled this again and found my own solution :)
Hurray for me.

How did you do it?
Same problem here and no help on the forum till now. I'd like to mantain the logo with transparency!
I see fpdf 1.6 does support alpha channels. I tried inserting it right away but seems like it needs the modification someone did on it for vm because it returns nothing.