issues with transparent background for PNG and/or GIF files - Page 2 issues with transparent background for PNG and/or GIF files - Page 2
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

issues with transparent background for PNG and/or GIF files

Started by brynn, January 29, 2014, 06:23:49 PM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

brynn

I don't know how to summarize my problem any better than in my op. 

I don't understand some of the discussion from Phill Lockhurst and gmc, so it's hard for me to clearly understand what they might or might not be on to.  So I apologize, but I can't clarify their discussion for you.

Maybe you could read through my op again, and for the moment, ignore their discussion.  Maybe it will be more clear that way?  If you don't understand my op, please feel free to ask.

(Still waiting for my new isp to take over.  Good chance I'll lose my connection any time now.  But hopefully I'll be back soon, whenever it happens  :o  :o)

____________
In case it matters.  And for the part of their discussion that I do understand:
For gmc, I've created a 2nd temporary album (http://inkscapecommunity.com/ic_gallery/thumbnails.php?album=28) and uploaded Phill's lower bit PNG as both the original and the custom thumb.  The original appropriately displayed the bg, before the custom thumb was applied.  And it still is correct bg after custom thumb is applied.

However, it looks like Phill had taken a thumbnail from my album, rather than the full size PNG.  I'm not sure if it makes for a fair test, to use a thumbnail.  I guess if he took it from my PNG original, it should be fine.  But if he took it from one with the black bg, it might not be good to use for testing.

Even though Andre said it should not matter whether the original image is an SVG or not, I still wonder, based on my first experience (memorialized in the linked reference topic above).  So in this 2nd temporary album, I uploaded again, my original mand2.svg.  Then I applied Phill's low bit PNG as the custom thumbnail.

You can see, that even though I used the same PNG (Phill's low bit) as the custom thumb, on both images, Phill's low bit PNG as the original shows a correct bg for the custom thumb, and my mand2.svg as the original shows the black background.

So I learn 2 things from this:

1 -- The Custom Thumbnail plugin does behave differently when the original is an SVG.
and
2 -- The low bit color does not fix the problem.

This is only valid if Phill's low bit PNG came from my original PNG upload.  If he took it from one with the black bg, might not be fair test.

brynn

Quote from: brynn on January 31, 2014, 04:21:40 PM
So I learn 2 things from this:

1 -- The Custom Thumbnail plugin does behave differently when the original is an SVG.
and
2 -- The low bit color does not fix the problem.

This is only valid if Phill's low bit PNG came from my original PNG upload.  If he took it from one with the black bg, might not be fair test.

Re:  1 -- The Custom Thumbnail plugin does behave differently when the original is an SVG. 

Edit:

BUT it only is happening with THIS mand2.svg using mand2.png as the custom thumbnail.

Note in this album:  http://inkscapecommunity.com/ic_gallery/thumbnails.php?album=18, the image titled kal-2.svg.  For it's custom thumb, I used kal-2.png.  And you can see that there is no black bg there.

brynn

Attached are the same files I did the above tests with.  (zipped)

phill104

So let me get this straight, with the PNG I supplied it works OK. With the PNG from your SVG file it does not correct?
It is a mistake to think you can solve any major problems just with potatoes.

brynn

Quote from: Phill Luckhurst on January 31, 2014, 06:08:34 PM
So let me get this straight, with the PNG I supplied it works OK. With the PNG from your SVG file it does not correct?

No.

Is there something wrong with my English?  I'm sorry, it's all I know.  I'm not sure how many different ways I can explain the same thing.  If I'm using the wrong terminology somewhere, please tell me what the correct terminology is.  After all, I do want to make it as easy as possible for you  :)

If I upload your low bit PNG as the original image, (which looks ok) and then I use your same low bit PNG as the custom thumbnail, it looks ok.

If I upload my SVG (mand2.svg) as the original, and then I use your same low bit PNG as the custom thumbnail, it gets a black background.  (It also gets a black bg if I use my mand2.png as the custom thumb.)

You can see the results here:  http://inkscapecommunity.com/ic_gallery/thumbnails.php?album=28

Note that so far, the problem is only happening when mand2.svg is used as the original and mand2.png is used as the custom thumbnail.

Quote from: brynn on January 31, 2014, 04:30:10 PM
Note in this album:  http://inkscapecommunity.com/ic_gallery/thumbnails.php?album=18, the image titled kal-2.svg.  For it's custom thumb, I used kal-2.png.  And you can see that there is no black bg there.

brynn

Quote from: brynn on January 31, 2014, 07:12:51 PM
Note that so far, the problem is only happening when mand2.svg is used as the original and mand2.png is used as the custom thumbnail.

Edit:

It happened with another SVG, when I first posted the other topic, but I thought the problem was solved and deleted it.  And now, I can't remember which one it was.  But I could try uploading all the images that I remember using, and maybe I will find it.  If that would be helpful for you to have 2 examples, I don't mind trying.  Lmk :)

Αndré

Quote from: brynn on January 31, 2014, 07:12:51 PM
If I upload my SVG (mand2.svg) as the original, and then I use your same low bit PNG as the custom thumbnail, it gets a black background.  (It also gets a black bg if I use my mand2.png as the custom thumb.)

I just downloaded your test_files.zip file. Then, I uploaded mand2.svg and used the custom thumbnail plugin to apply first brynns_original_mand2.png and then PLs_lowbit_mand2.png as custom thumbnail, while creating an intermediate-sized version each time. All created files have a transparent background.

Can somebody confirm that behavior please? Thanks.

phill104

It is a mistake to think you can solve any major problems just with potatoes.

Αndré

brynn, please test again with exactly the same steps I just posted. To avoid any unexpected file name collisions, please upload the test SVG file to a separate directory in your albums directory and add it via batch-add. I assume you'll get the same result as Phill and me. If so, I already have an idea what may happened.

brynn

Ok, glad to :)

Couple questions.

QuoteThen, I uploaded mand2.svg and used the custom thumbnail plugin to apply first brynns_original_mand2.png and then PLs_lowbit_mand2.png as custom thumbnail, while creating an intermediate-sized version each time.

Do you mean that you applied brynns_original_mand2.png, as custom thumb, to mand2.svg, and then applied PLs_lowbit_mand2.png, as custom thumb, to the same mand2.svg?  Or did you upload mand2.svg twice, applying brynns_original_mand2.png, as custom thumb, to one, and PLs_lowbit_mand2.png, as custom thumb, to the other?

Since I've never used batch-add, I had to read up on it in the manual.  Do you mean that you want me to upload the images from test_files.zip using my SFTP, and then perform the batch-add?  Or do you mean to upload via html (which is how I have been doing it all along) and then perform the batch-add?

Αndré

Quote from: brynn on February 06, 2014, 03:09:59 AM
Do you mean that you applied brynns_original_mand2.png, as custom thumb, to mand2.svg, and then applied PLs_lowbit_mand2.png, as custom thumb, to the same mand2.svg?
Yes, I did exactly as I wrote.


Quote from: brynn on February 06, 2014, 03:09:59 AM
Do you mean that you want me to upload the images from test_files.zip using my SFTP, and then perform the batch-add?
Yes.


Quote from: brynn on February 06, 2014, 03:09:59 AM
upload via html (which is how I have been doing it all along) and then perform the batch-add?
That's not possible, at least not with Coppermine's built-in features.

brynn

Ok, bearing in mind that I don't clearly understand what you're thinking and why I'm doing these steps, I've done my best to follow instructions.

I uploaded mand2.svg, brynns_original_mand2.png, and PLs_lowbit_mand2.png to a new folder (created using Bitvise SFTP) in public_html/ic_gallery/albums called testftp.  Then I used Batch-Add and added them to brand new album "3rd_temporary_test" album.  Success so far.

The next part I might not have done right.  I opened the intermediate page of mand2.svg, and used Custom Thumbnail button to apply brynns_original_mand2.png.  The reason I'm not sure that's right, is because that custom thumbnail uploads the PNG from my computer, and not from the batch-added PNG.  I don't know how to get it from the ftp uploaded PNGs.

But leaving aside my doubts for the moment, the result of that was a black background on the new custom thumbnail, and correctly sized and background intermediate.  Next I clicked Custom Thumbnail button again, and applied the other PNG.

And I apologize, but I might have forgotten to check intermediate for the 2nd PNG.  I can do this all again tomorrow, if necessary, if not checking intermediate has ruined the test.  But I have to log off right after I post this, and won't be back until tomorrow night or Friday.

So anyway, after applying the 2nd custom thumb, I have a custom thumbnail with a black background, and and intermediate that's the size of a thumbnail, and also has a black background.  (That's what makes me think I might have forgotten to check intermediate.  Actually, I thought I did check it.  But the thumb sized intermediate makes me wonder.)

And you can see the final result here:  http://inkscapecommunity.com/ic_gallery/thumbnails.php?album=29

Oh!  I can find out if I checked intermediate by looking in the server for it, right?  Hhmm, actually, I'm not sure what I'm looking at, on the server.  There are 3 new images that start with thumb_, but only 1 that starts with normal_.  I would have expected 2 of each, so that's why I'm confused.  But maybe it makes more sense to you?

Anyway, let me know if you want me to do it again.  And again, I apologize for that.  Thanks for all your help, and I'll be back online maybe 18 hours from now (if plans don't change).

All best  :)

Αndré

Quote from: brynn on February 06, 2014, 11:16:57 AM
I uploaded mand2.svg, brynns_original_mand2.png, and PLs_lowbit_mand2.png
This was already wrong.

brynn


brynn

Rather than delete files, I made a new folder using my SFTP (in albums dir) and uploaded only mand2.svg.  Then I made another new album (fourth_temp_test) and batch added just that 1 file.

Then I clicked Custom Thumbnail button, selected brynns_original_mand2.png, checked intermediate and clicked Upload.  Result:  thumbnail has black background, intermediate is correct.

Then I clicked Custom Thumbnail button again, selected PLs_lowbit_mand2.png, checked intermediate, and clicked Upload.  Result: thumbnail with black background and intermediate same size and bg of thumbnail.

You can see the result here:  http://inkscapecommunity.com/ic_gallery/thumbnails.php?album=31.

Αndré

Please upload a different file type (e.g. a JPG file or PDF file, or even better: both) with a different file name than "mand2" and try again to apply both images as custom thumbnail. I don't see a reason how this should be related to the file type the custom thumbnails are applied to.

brynn

Do you mean for me to convert mand2.svg to a JPG and also a PDF, change the name, and upload those?  Or do you mean for me to use 2 entirely different images?

Still using ftp and batch-add?

phill104

A totally different file type as per Andre above. Any PDF will do.
It is a mistake to think you can solve any major problems just with potatoes.

brynn

I'm sorry that I have to ask so many questions.  I just don't understand what's causing the problem, or even what might be causing it.  So sketchy requests which might be clear to people with more advanced understanding of how CPG works, are not necessarily clear to me.

For example, I don't understand why me having uploaded 3 images via ftp and batch-add, instead of just 1, should make the test invalid.  So when something like that is so important, I want to make sure exactly what:

"Please upload a different file type (e.g. a JPG file or PDF file, or even better: both) with a different file name than "mand2"...."

means.  I'm also not sure if I should make a new album.  But since he didn't say so, I'll use an existing one.

Ok, I've uploaded a file "tulips.jpg" (which is titled "testing JPG as original") in this album:  http://inkscapecommunity.com/ic_gallery/thumbnails.php?album=31.  Applying "brynns_original_mand2.png" as first custom thumbnail, I get a thumbnail with a black background, which is the correct width but incorrect height.  So the thumbnail is out of proportion and has black background, while the intermediate is correct size and bg.

Next, applying "PLs_lowbit_mand2.png" as custom thumb, "on top of" the first custom thumb, there is no change in the thumbnail.  It still is out of proportion and has a black bg.  And now, the intermediate is a correctly proportioned thumbnail size, with a black bg.

Uh-oh....oops :-[  I uploaded tulips.jpg via html.  Did you mean for me to use ftp/batch-add?  Just in case, I'll do it that way too.

Ok, you can see the 3rd thumbnail, which is the 2nd mis-proportioned thumbnail, which has no title, (because I didn't see a way to add a title) (except by later editing file info) for "tulips.jpg" which I uploaded via ftp (to brand new folder) and batch-add, in this album:  http://inkscapecommunity.com/ic_gallery/thumbnails.php?album=31.  Then I went through the same routine with custom thumbnails.  No difference in results.  Exactly the same results as html upload.

And now for PDF..... 

Well it looks like I haven't configured properly for PDF.  When I tried to upload a PDF, I got an error message:

"The file you have uploaded is not a valid image!"

So I'll have to figure out how to fix that, if you really need this test with PDF.  Please let me know if you need it right away.


Αndré

This thread took and is already too long to re-read it again every time. However, If I remember correctly you said the transparent background is lost if you apply a picture with transparent background as custom thumbnail, but just for SVG files. You just disproved that, as you got the same result for a JPG file (that's why I asked you to test with different file types than SVG).

Which settings do you use for Method for resizing images? GD2 oder ImageMagick? If you use ImageMagick, does it work as expected if you switch to GD2?

Please also provide a test user account (no admin account!), so we can exclude any client side issues.