Hi folks! I am trying to see if gallery addon is what I need :)
So, I add one to my Pier site. Then I use the "Import Pictures" command and select a zip I have with pictures. After saving the upload I receive the error: "Import pictures: Only zip files are accepted" But my file IS a zip. Any ideas? Thanks Mariano _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On Wed, Jun 10, 2009 at 3:45 PM, Mariano Martinez
Peck<[hidden email]> wrote: > So, I add one to my Pier site. Then I use the "Import Pictures" command and > select a zip I have with pictures. After saving the upload I receive the > error: "Import pictures: Only zip files are accepted" It seems your file is not recognized by the zip algorithm of Squeak. I don't know why, you will have to debug that. -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On Wed, Jun 10, 2009 at 2:38 PM, Damien Cassou <[hidden email]> wrote:
I tough the same and as I were in Linux, I tried to zip it in Windows, but I got the same results. I can also debug it and see what the problem is. I just ask because perhaps this was a known problem or someone has already faced it.
_______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On Wed, Jun 10, 2009 at 5:42 PM, Mariano Martinez
Peck<[hidden email]> wrote: > I can also debug it and see what the problem is. I just ask because perhaps > this was a known problem or someone has already faced it. I tried it and it worked for me at that time. Please tell me if there is something wrong in my code. -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Today, I test it again in another windows machine and I have another problem. When saving the uploaded zip file, I have the following error:
"Error: Fotos/foto_flor.jpg is an invalid child in Galeria." Suppose my file is called "fotos.zip" and I have a photo inside called 'foto_flor.jpg' After debugging for a while, this is the problem. ZipArchive generates a member with fileName 'fotos/foto_flor.jpg'. Then when trying to addPictura a validation is done: PRPath>>isValidName and when it does: aString allSatisfy: [ :char | self validCharacters includes: char ] In this case, aString is 'fotos/foto_flor.jpg' and '/' is not in validCharacters. So, what can I do? 1) add '/' to self validCharacters ? I think this has a lot of impact in other places 2) in PGImportArchiveCommand>>addPicture: archiveMember remove the '/' when creating the picture (PGPicture) object what should I do? any other idea? Thanks! Mariano On Wed, Jun 10, 2009 at 2:46 PM, Damien Cassou <[hidden email]> wrote: On Wed, Jun 10, 2009 at 5:42 PM, Mariano Martinez _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
In reply to this post by Damien Cassou-3
On Wed, Jun 10, 2009 at 12:38 PM, Damien Cassou <[hidden email]> wrote:
After debugging I found this problem: when I upload a zip file in linux, the mimetype is "application/zip". And subtype is: subtype "Answer the second part of the mime-type." ^ self mimetype copyAfter: $/ So PGImportArchiveCommand>>doValidate when it does (self file subtype = 'zip') this is true :) But, in Linux, the mimetype is "x-zip-compressed"....so subtype is 'x-zip-compressed' and (self file subtype = 'zip') gives false.... Now, does someone has a better idea than doing this piece of hack: #PGImportArchiveCommand doValidate super doValidate. (self file subtype = 'zip') ifFalse: [ (self file subtype includesSubString: 'zip') ifFalse:[MAConditionError description: self description signal: 'Only zip files are accepted'] ]. However, after validating, when I press "save" I have another problem: FileDoesNotExistException: '/home/mariano/squeak/imagenes/Seaside-2.8.4.app/Contents/Resources/files/46/rfxaf2dt4t7nyrzmg2cam6i1yknaji/pagina/PN Los Alerces.jpg' The thing is that the folder "pagina" (the zip uncompressed) was never created. There can be a problem when trying to uncompress ? where is this done? so that I can debug.... Thanks for the help :( Mariano
_______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
In reply to this post by Mariano Martinez Peck
On Wed, Jun 10, 2009 at 8:01 PM, Mariano Martinez
Peck<[hidden email]> wrote: > 2) in PGImportArchiveCommand>>addPicture: archiveMember > remove the '/' when creating the picture (PGPicture) object In that case you will have problems if there are multiple identically named files in the zip. But that should be ok for most cases. -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
In reply to this post by Mariano Martinez Peck
On Thu, Jun 11, 2009 at 2:05 AM, Mariano Martinez
Peck<[hidden email]> wrote: > But, in Linux, the mimetype is "x-zip-compressed"....so subtype is > 'x-zip-compressed' I think that's a bug in Pharo because on command line I get application/zip. -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
In reply to this post by Damien Cassou-3
On Thu, Jun 11, 2009 at 6:25 AM, Damien Cassou <[hidden email]> wrote: On Wed, Jun 10, 2009 at 8:01 PM, Mariano Martinez Yes, that's true. But you even can't do that in windows :) I mean, you cannot have two identically named file in a directory.
_______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On Thu, Jun 11, 2009 at 3:14 PM, Mariano Martinez
Peck<[hidden email]> wrote: > Yes, that's true. But you even can't do that in windows :) I mean, you > cannot have two identically named file in a directory. No, but you can have identically named files in a zip if they are in different folders of the zip file. If you just ignore the folders, you may have conflicts. -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On Thu, Jun 11, 2009 at 12:34 PM, Damien Cassou <[hidden email]> wrote: On Thu, Jun 11, 2009 at 3:14 PM, Mariano Martinez Ups...That's true. You are right. Anyway, do you know which is the use of the fileName in the picture? Because perhaps having two objects with the same name is not a problem. Cheers, Mariano
_______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
On Thu, Jun 11, 2009 at 3:40 PM, Mariano Martinez
Peck<[hidden email]> wrote: > Ups...That's true. You are right. Anyway, do you know which is the use of > the fileName in the picture? Because perhaps having two objects with the > same name is not a problem. Not sure I understand your question. Each picture in the zip file will translate into a Pier structure. IIRC, the name of the file is the same as the name of the structure. Having two structures at the same level with the same name will certainly result in a conflict. -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry _______________________________________________ Magritte, Pier and Related Tools ... https://www.iam.unibe.ch/mailman/listinfo/smallwiki |
Free forum by Nabble | Edit this page |